rc.local does not execute at startup.

ozgurerdogan

Renowned Member
May 2, 2010
621
6
83
Bursa, Turkey, Turkey
I need to automount sshfs so I added needed line to rc.local file.
My problem is only the rc.local not executing (although it is 755 and so should be executed). I don't have the map problem.
if I run "/etc/rc.local" from shell, it correctly executes! It just doesn't run at boot
 
I need to automount sshfs so I added needed line to rc.local file.
My problem is only the rc.local not executing (although it is 755 and so should be executed). I don't have the map problem.
if I run "/etc/rc.local" from shell, it correctly executes! It just doesn't run at boot
It may be due to lack of execution bit.
Do this:

# chmod +x /etc/rc.local
 
It may be due to lack of execution bit.
Do this:

# chmod +x /etc/rc.local
BTW, don't forget the following single line at the top of the rc.local file:

#!/bin/sh -e

And, don't forget the following single line at the end of the rc.local file:

exit 0

If you forget them, the OS won't run the whole of script!
 
Last edited: