2

I know this question has been asked a lot of times already, and I think I might have tried everything suggested on the internet, but I just can't get it running

/etc/rc.local:

#!/bin/sh -e

while :
do

    alsactl restore
    if [ $? = 0 ]
    then
        echo "alsactl restored" >> ~/Desktop/rc.log
        break
    else
        echo $?
    fi
    sleep 2

done

exit 0

permissions are

$ ls -l /etc/rc.local
-rwxr-xr-x 1 root root 855 Jul   5 17:05 /etc/rc.local

any ideas?

Ubuntu 14.04

Anthon
  • 277
vch
  • 133
  • You need to add exit 0 at the end of the /etc/rc.local file..run this sudo bash -c 'echo "exit 0" >>/etc/rc.local' – heemayl Jul 05 '15 at 16:55
  • oh, yes, it is there already, my bad - didn't copy it to the end. fixed the question – vch Jul 05 '15 at 18:11
  • Does /root/Desktop exist? If not, the script will error out either way since you have -e on the shebang. – muru Jul 05 '15 at 18:12
  • You need to have the full path to all commands since rc.local is run before $PATH is set – Grammargeek Jul 05 '15 at 19:50

0 Answers0