Self watchdog script

listed in answer

Self watchdog script
0 votes, 0.00 avg. rating (0% score)

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