I am wondering if this is behavior due to SELinux or something else.
I have a deploy script that I run and inside, I had
sudo chmod +x /etc/rc.local, and some lines later I echo some startup commands,
grep "startupcmd" /etc/rc.local || sudo echo "startupcmd &" >> /etc/rc.local
I found that this would always leave my
I puzzled over it, then I thought Linux was somehow magically doing this to help me. So I move the
chmod +x to the end of the file, and it works great now.
This was experienced on a Raspberry Pi 2 Debian (Raspbian), by the way. (which does not appear to have any SELinux set up)