Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want to run a process in rc.local (Ubuntu Natty) but I am having trouble determining if it has run. I added

/bin/sleep 10
/usr/bin/killall PassengerWatchdog
/bin/echo "Killall returned with code $?"

The file has the execute bit set. The script starts with #!/bin/sh I would expect the echo to go to /var/log/boot.log

This is obviously just a hack to see if I can fix a problem. How can I tell if the script executed?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Redirect the output of your script to a file in rc.local e.g.

/path/to/yourscript >/tmp/script.out 2>&1

which should capture the stdout and stderr from yourscript.

share|improve this answer

In order to log all the output to a file, i.e., add the following to all your commands in rc.local:

>> /var/log/rc.local.log 2>&1

This will collect both stdout and stderr to /var/log/rc.local.log

then you should be able to know what happened.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.