Stopping starting and enabling services on boot.

With a Linux install many services or daemons are started as you boot up. These provide functionality and information to your own applications as you run them.

Being able to control which services are started at boot time is essential for any Systems Administrator. The commands below are for Debian based distro’s like Ubuntu.

All the examples below use the Apache server as the service we are playing around with.

Checking the service status, that is, is it running or stopped etc..

sudo system apache2 status

To enable or disable a service, so that it starts up as your machine boots up

sudo update-rc.d apache2 defaults

sudo update-rc.d apache2 -f remove
sudo update-rc.d apache2 -f enable [S|2|3|4|5]
sudo update-rc.d apache2 -f disable [S|2|3|4|5]

The three commands to start, stop or restart which are usually present for any service.

sudo system apache2 start
sudo system apache2 stop
sudo system apache2 restart

Leave a Reply

Your email address will not be published. Required fields are marked *