This question already has an answer here:
- init.d script not being run on boot 2 answers
I have a script that I want to run at startup and on shutdown.
I have placed the file in
/etc/init.d and named it testscript.sh
Then I changed permissions
sudo chmod 755 testscript.sh
Then I made link
ln -s /etc/init.d/testscript.sh /etc/rc2.d/S99testscript.sh
So far so good, now the script runs at startup. I tried doing the same but making the links in rc0.d and rc6.d but that didn't work, the script still won't run at reboot/shutdown.
What am I doing wrong?
I'm running Ubuntu on putty client.