[SOLVED]Disabling unnecessary services

Message
Author
Marek
Posts: 135
Joined: Sun Apr 19, 2020 1:00 pm

[SOLVED]Disabling unnecessary services

#1 Post by Marek »

Welcome. If such a topic already exists, please feel free to redirect it. It is about services. I would like to disable the ones that listen unnecessarily, such as avahi-daemon, or sshd, inted, rpcbind. How can I achieve this without harming the system? Thank you very much in advance for any tips
Last edited by Marek on Mon Jul 11, 2022 1:58 pm, edited 1 time in total.

User avatar
AVLinux
Posts: 3241
Joined: Wed Jul 15, 2020 1:15 am

Re: Disabling unnecessary services

#2 Post by AVLinux »

The easiest way without installing anything is is enabling and disabling things in the Session Startup utility, which version of MX are you using (ie XFCE, KDE or Fluxbox)?

Marek
Posts: 135
Joined: Sun Apr 19, 2020 1:00 pm

Re: Disabling unnecessary services

#3 Post by Marek »

No no. The services listed, are generally not applications, as such. They are not included in the autostart. Their startup scripts, are located in /etc/init.d. I'm slowly starting to explore the topic, because there is a lot of instructions and documentation for Debian, you just need to know how to look for it, and with me, there is trouble sometimes 9_9

User avatar
AVLinux
Posts: 3241
Joined: Wed Jul 15, 2020 1:15 am

Re: Disabling unnecessary services

#4 Post by AVLinux »

I haven't used it in years but there was an ncurses utility called rcconf (or something like that)..

I see in Synaptic there is a utility called sysv-rc-conf which is a terminal based utility for services etc... Might be worth investigating..?

Stuart_M
Posts: 708
Joined: Wed Aug 07, 2019 7:10 pm

Re: Disabling unnecessary services

#5 Post by Stuart_M »

One of the things I do after an installation is to disable services that I will never need.

The below code window shows four ways I use to view the status of a service. All of these commands are installed by default in MX-18, 19 and 21.

The first command will show the status of all the services.
The second will show the status of one service.
The third shows the status of only enabled services.
The fourth (sysv-rc-conf) will show services in a SysV runlevel configuration table. The arrow keys are used to select run levels that a particular service will run, but may be a little more difficult for removing a service because all the enabled levels will have to be toggle off.

Code: Select all

sudo service --status-all
sudo service <service> status
systemctl list-unit-files --type=service --state=enabled
sudo sysv-rc-conf

I use the following command to disable a service from all run levels:

Code: Select all

sudo update-rc.d <service> disable
To add, disable, enable, or remove a service with update-rc.d:

Code: Select all

sudo update-rc.d <service> defaults     (add service)
sudo update-rc.d <service> disable      (disable service with init script available)
sudo update-rc.d <service> enable       (enable service)
sudo update-rc.d <service> remove       (remove service)

While you said you were interested in removing services that "listen unnecessarily" I though you might be interested in the services that I disabled (MX-18, 19, and 21) because I have no need for them:

avahi-daemon (I don't use printers)
bluetooth (I don't use bluetooth)
cups (I don't use printers)
cups-browsed (I don't use printers)
*nfs-common (I don't have a NFS)
nfs-kernel-server (I don't have a NFS)
nmbd (I don't use samba)
pppd-dns (I don't use dial-up Internet)
*rpcbind (I don't use NFS)
*saned (I don't have a scanner)
smbd (I don't use samba)

* These required a reboot for the disabled status to show.

User avatar
anticapitalista
Developer
Posts: 4315
Joined: Sat Jul 15, 2006 10:40 am

Re: Disabling unnecessary services

#6 Post by anticapitalista »

You can disable/enable at install time too.
anticapitalista
Reg. linux user #395339.

Philosophers have interpreted the world in many ways; the point is to change it.

antiX with runit - lean and mean.
https://antixlinux.com

User avatar
AVLinux
Posts: 3241
Joined: Wed Jul 15, 2020 1:15 am

Re: Disabling unnecessary services

#7 Post by AVLinux »

Great info!

Marek
Posts: 135
Joined: Sun Apr 19, 2020 1:00 pm

Re: Disabling unnecessary services

#8 Post by Marek »

Thank you very much for your help. I was able to disable the listening services. Only the network-manager at the connection remained. @AVLinux Thank you for pointing out the tool in cli. @Stuart_M Thank you very much for such a comprehensive answer. It explains a lot. @anticapitalista Yes I disable some services at the installer level, but a few need to be disabled otherwise though. Thank you all very much!

Post Reply

Return to “Software / Configuration”