The following is mostly taken from the example published at https://mkaz.com/2013/07/03/run-script-at-start-on-debian/
Write an init.d script according to the the dependency-booting specification (see at https://wiki.debian.org/LSBInitScripts).
, say it foo.sh
. Place the script under /etc/init.d
.
ln -s /root/scripts/foo.sh /etc/init.d/foo
Update the runlevel directories under /etc/rc*
:
update-rc.d foo defaults
thanks pal,
I had forgotten how to add a service, not used for a very long time.
You have no idea how many search results there were for this: paywalls mostly, and idiots who answer 'why would you need that'....
Great contribution, you have no idea how valuable this small snippet has just been.
Just for that one line: update-rc.d .
Mike