Self watchdog script
listed in answer
ANSWER:
You can use a lock that remains in memory (usually /tmp is a tmpfs mount) that will be removed at boot:
[ ! -f /tmp/rc.local.lock ]&&touch /tmp/rc.local.lock||exit
I think that the problem is that you do not have the same environment available in your script compared to ssh shell (e.g. PATH…). You should write the output of the script in a log file. Just add this line at the beginning of the script.
exec >/tmp/rc.local.log 2>&1
by Mircea Vutcovici from http://serverfault.com/questions/382108

New Comments