HOWTO: Make a Script Start in All Runlevels in a Debian System?
Sometimes it’s useful to start a script in all, or at least the most used, runlevels. In a Debian system, do this:
For example purposes, we want to start the script named ‘foo.sh’
- As root, type:
update-rc.d foo.sh defaults
The defaults argument causes foo.sh to start in runlevels 2,3,4,5 and stop in 0,1,6.
To make foo.sh start in runlevels 1,2,3 use the command:
update-rc.d foo.sh start 1 2 3 . stop 0 4 5 6 .
More information can be found on the update-rc.d man page, here.
Related Stories
POSTED IN: How To
0 opinions for HOWTO: Make a Script Start in All Runlevels in a Debian System?
No one has left a comment yet. You know what this means, right? You could be first!
Have an opinion? Leave a comment: