On Mon, 25 Jun 2018 07:07:52 +0800
Ed Greshko wrote:
I don't recall how I found my mistake. I do remember putting in
a few "touch"
commands in the script to create files and thereby narrow down where in the script
I'd gone wrong.
Two things that often cause rc.local failures:
1. Having a different $PATH as root than as your normal user.
2. If you are trying to start a long running process
(Like launch a daemon), the "new and improved"
systemd will helpfully kill it off for you
shortly after it is started.
This has led me to transform my rc.local script into this:
/usr/bin/at -M now <<'HERE' > /dev/null 2>&1
/etc/rc.d/the-real-rc.local
HERE
Then move everything I used to be able to put in rc.local
into the-real-rc.local instead (sheesh!)
Oh yea, silliest thing to check:
Is rc.local executable, does the first line start with #!/bin/sh ?