I am struggling to figure out why rc.local won't be executed at boot time.
The file itself is executable, it is called from /etc/rc2.d
Also the file when from command line won't return any errors.
Any ideas what else to check to figure out why is not run?
Linux – On a Debian 7.5 rc.local won’t be run at boot
debianinit.dlinuxrc.local
Related Topic
- How to test /etc/rc.d/rc.local to make sure a command will start successfully at boot
- Debian – sshfs mount won’t start from /etc/rc.local
- Linux – Using rc.local to run a command on boot
- Linux – Run python script inside /etc/rc.local doesn’t work
- Linux Boot Issue – Startpar Process Left Hanging When Starting from rc.local or init.d
- Debian – How to start headless X upon boot for non-root users in Debian
Best Answer
Since you say that
rc.local
executes properly when you run it manually, the two things that immediately come to mind are:/etc/rc.local
really isn't being run at boot.In both cases, the first thing I'd do is put something like
as the very first line of
rc.local
after the#!/bin/sh
line. That'll print the environment variables to a timestamped file every it is run. (Don't write the file to/tmp
because that's emptied at boot.) Run/etc/rc.local
manually and take a quick look at the resulting file (it'll be named something like/var/tmp/rc.local-21:14:35
). Then reboot your system.You should have two files in
/var/tmp
(or wherever) that you can compare. If you only the first file,/etc/rc.local
isn't really getting called. If you have two files, compare them. The later one will have a very sparse environment and PATH. Look through yourrc.local
script and see if there's anything you're trying to run that depends on some variable or some component of PATH that's not in the boot-time environment. If you find something, add the necessary initialization torc.local
.