I have written a simple bash script:

echo "hi" > log
exit 0

made it executable and its successfully running. I edited my rc.local to the following:

#!/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.


exit 0

rc.local is executable:

/$ ls -l /etc/rc.local
-rwxr-xr-x 1 root root 349 Aug  1 13:19 /etc/rc.local

What's working:

1.I directly put echo "hi" > /home/katph/log in rc.local, it works fine.Meaning rc.local runs at startup.

2.If I manually run rc.local with the script, log file is created correctly.

Any suggestion? I'm running Kubuntu14.04.

  • If you run bash -x /etc/rc.local, do you see any action? Aug 1 '15 at 8:38



by an absolute path



echo "hi" > /home/katph/log
exit 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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