Enable service at boot time on debian server
To enable the a service on debian server at boot time you can use the following commands
update-rc.d service_name start NN runlevel . stop NN runlevel
where NN decide which order to run the scripts in the /etc/init.d folder.
Example
update-rc.d httpd start 20 2 3 4 5 . stop 20 0 1 6 .
update-rc.d httpd defaults
update-rc.d httpd defaults
Both the command will start httpd service in run-levels 2, 3, 4, and 5, and stop the service in run-levels 0, 1, and 6.
To stop a service from starting on bootup, execute the command
update-rc.d –f service_name remove
Example: update-rc.d -f httpd remove
Example: update-rc.d -f httpd remove
This command will stop the service httpd from starting when the server is booted.
To manually start a service you can use the command
/etc/init.d/httpd restart
invoke-rc.d httpd restart
invoke-rc.d httpd restart
Leave a Reply
You must be logged in to post a comment.