Hi All,
I have a board running embedded Linux in it. I need to have a script that has to run forever i.e even if it exit's for any reason,it should be stated again. So I added a entry in the /etc/inittab file and made this script as 'respawn' entry.
::respawn:/flash2/scripts/hello_world.sh
In the script, I call a binary 'hello_world' with it's absolute path and the binary is in '/flash2/bin' whose path is exported to the PATH variable.So it should get executed.
My /etc/inittab looks like below
# System initialization. ::sysinit:/etc/init.d/rcS
#Run gettys ttyS1::respawn:-/bin/sh
#Test respawn ::off:/flash2/hello_world.sh
# Trap CTRL-ALT-DELETE ::ctrlaltdel:/bin/umount -a -r
So the system initialization script /etc/init.d/rcS execute's first and it is in this script the '/flash2/bin' path is added to export variable.
But once the board boots, the script 'hello_world.sh' is executed, but the binary 'hello_world' is not executed.It keeps throwing the following message
/flash2/hello_world.sh: 5: hello_world: not found /flash2/hello_world.sh: 5: hello_world: not found /flash2/hello_world.sh: 5: hello_world: not found /flash2/hello_world.sh: 5: hello_world: not found /flash2/hello_world.sh: 5: hello_world: not found /flash2/hello_world.sh: 5: hello_world: not found
The '/flash2' is the NOR flash partition.
Why is it not able to find 'hello_world' binary whose path is exported to PATH.
If any clarification needed,please let me know if the explanation is not clear.