I try to run some commands at boot. I learned that one should add them in the /etc/rc.local file (on ubuntu 12.04 LTS).
Here my file:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
/usr/bin/touch /tmp/test.rc.local
exit 0
But after reboot no file was created in /tmp/ which indicates to me that rc.local was never executed.
Note: rc.local as (in my opinion) the right permission:
> ls -l rc.local
-rwxr-xr-x 1 root root 446 Sep 3 15:55 rc.local
ls -al /tmp/test.rc.local
you get nothing after rebooting with the file like that? – Sylwester Sep 03 '13 at 21:22/tmp
can be--and often are--cleared on reboot. (Often, they are not even really written to disk.)/tmp
is a place to store temporary files that don't need to be kept around. You should put the file elsewhere if you need to keep it. – Eliah Kagan Sep 03 '13 at 20:42