I have written a simple bash script:
#!/bin/bash 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. /home/katph/test.sh 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
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.