Debian Service

I have found a couple Debian based distributions that have trouble turning off services at start up. To begin, services are background jobs that run on *nix systems. In compression to Windows they are what you can find by opening the task manager and finding the processes. You don’t see the programs running because they are in the back ground. Most of these services are harmless but unnecessary. To stop a service in a Debian system type in the command.

sudo service servicename stop

or

sudo /etc/init.d/servicename stop

This stops the service running while the system is running. Replace the service with the name of the service. The best way to see what the service is called it by typing

cat /etc/services

If you can’t find the service then try

ps aux | grep servicename

Then use

sudo kill -9 PID

to stop the service.

Now the trouble, when trying to stop the script to activate the service at start up it is

sudo update-rc.d -f servicename remove

This command will remove the smybolic links between the startup scripts in the /etc/init.d/servicename

It seems that a couple Debian distributions have changed the way startup scripts work. You wouldn’t want an administrator or anyone that had root or sudo access to turn off a service by mistake or purpose. After searching I found a command that will write an orerride file that the /etc/init.d files will search for before running a service.

echo manual | sudo tee /etc/init/servicename.override

I have tried this command in Ubuntu and Zorin right now and rebooted both and the services I want to stay off have stayed off. If I need to turn them on, I will do it manually then turn them off. This helps ti keep an eye on which services are running and being able to control them.

Leave a Reply