Custom linux service at boot

So you’ve created a service in Linux, written a start/stop script for it, stored it in /etc/init.d/ and now you want it to actually run on boot/restart. This little line of code at a root terminal will do the trick for you.

update-rc.d <script> defaults 98 02

The <script> should be replaced with the file name of your start/stop script in /etc/init.d/ the 98 ensures it’s (likely) to be the last script to start and the 02 ensures it’s (likely) to be the first to stop.

 

Possibly related articles

Comments are closed.