I'm trying to start a script on bootup on a Ubuntu Server 10.10 machine.
The relevant parts of my rc.local look like this:
/usr/local/bin/python3.2 "/root/Advantage/main.py" >> /startuplogfile
exit 0
If I run ./rc.local from /etc everything works just fine and it writes the following into /startuplogfile:
usage: main.py [--loop][--dry]
for testing purposes this is exactly what needs to happen. It won't write anything to startuplogfile when I reboot the computer. I'd venture to guess that the script is not started when rc.local is run at bootup.
I verified that rc.local is started with a 'touch /rclocaltest' in the file. As expected the directory is created.
I've tested rc.local with another python script that simple creates a file in / and prints to the /startuplogfile. From terminal and after reboot, it works just fine.
my execution bits are set like this:
-rwxrwxrwx 1 root root 4598 2011-04-22 19:09 main.py
I have absolutely no idea why this happens and I tried everything that I could think of to remedy the problem. Any ideas on what could be causing this, I'm totally out of ideas.
EDIT: I forgot to mention that I only login to this machine over ssh. I'm not sure that makes difference since rc.local is executed before login as far as I know.
EDIT: I noticed that this post is a little chaotic so let me sum it up:
- I verified that rc.local is called on bootup
- If rc.local is manually called everything works as expected
- Permissions are set correctly
- A testing python script works as expected on bootup with rc.local
- My actual python script will only run if rc.local is manually called, not on bootup