Page 1 of 2
Recommended way to disable/enable services?
Posted: Wed May 08, 2019 3:27 pm
by BV206
In MX what is the recommended way to enable or disable startup services that don't appear in Session and Startup / Application Autostart?
I want to keep the useless services below from automatically running. Some of them appear to be listening on the internet for devices or services that don't exist and I think they might be security hazards:
bluetooth (computer doesn't have bluetooth)
saned (no scanner)
cups (no printer)
cups-browsed (no network printer)
avahi-daemon (no network printer or file server)
samba (no network file server)
nmbd (no network file server)
smbd (no network file server)
nfs-common (no network file server)
nfs-kernel-server (no network file server)
openvpn (no vpn)
pppd-dns (no dial-up modem)
ModemManager (no dial-up modem)
unattended-upgrades (I manually check for upgrades very day)
There are several tools and commands I have run across:
sudo sysv-rc-conf
sudo rcconf
sudo update-rc.d [service] disable
sudo systemctl disable --now [service]
but I don't know if they all do the same thing or how they work in MX having both systemd and sysvinit and they don't all appear to work for all services.
Also what is the best way to list running services?
I have been using:
systemctl list-unit-files --type=service --state=enabled
on *buntu and it appears to work on MX but I don't know if it works properly on sysvinit.
Re: Recommended way to disable/enable services?
Posted: Wed May 08, 2019 4:02 pm
by timkb4cq
List running services with
For simply adding or removing services
Code: Select all
sudo update-rc.d [service] defaults # to add
sudo update-rc.d [service] disable # to disable but leave init script available to later
sudo update-rc.d [service] enable
sudo update-rc.d [service] remove # to remove
is probably best. n.b. - for remove to work the /etc/init.d/[service] file must already have been deleted, and obviously, to add one that file needs to be present.
sysv-rc-conf is quite useful for managing which run levels a particular service will run, but clumsier for removing one entirely since you have to toggle each level currently enabled.
Re: Recommended way to disable/enable services?
Posted: Wed May 08, 2019 4:21 pm
by Jan K.
But... surely the easiest way would be to deselect them at installation time?
Re: Recommended way to disable/enable services?
Posted: Wed May 08, 2019 4:27 pm
by Head_on_a_Stick
BV206 wrote: Wed May 08, 2019 3:27 pm
Also what is the best way to list running services?
I have been using:
systemctl list-unit-files --type=service --state=enabled
That command shows
enabled services, to list
running services use
Or
^ That will also show cgroups and their associated resource usage, which can be very useful.
For sysvinit please note that the
service --status-all command will only return useful information for init scripts that have a
status command and so it cannot list all running services, this is because sysvinit does not offer true process supervision (which is one of the reasons why Debian dropped it).
Re: Recommended way to disable/enable services?
Posted: Wed May 08, 2019 5:56 pm
by BV206
Jan K. wrote: Wed May 08, 2019 4:21 pm
But... surely the easiest way would be to deselect them at installation time?
How?
I installed MX last week and I don't recall the installer having any choices for anything but SAMBA, CUPS and SANE, and as far as I can tell those choices near the end of the installer don't work. I still had to go in afterwards and try to disable everything.
Re: Recommended way to disable/enable services?
Posted: Wed May 08, 2019 8:14 pm
by towwire
BV206 wrote: Wed May 08, 2019 5:56 pm
Jan K. wrote: Wed May 08, 2019 4:21 pm
But... surely the easiest way would be to deselect them at installation time?
How?
I installed MX last week and I don't recall the installer having any choices for anything but SAMBA, CUPS and SANE, and as far as I can tell those choices near the end of the installer don't work. I still had to go in afterwards and try to disable everything.
Some times it is worth reading a manual no matter how much knowledge we have.
Open the MX User Manual, go to Figure 2-20: Installer Screen 6. You will find a button "View" under 6d. Service Setting (advanced), if you had checked there you would have seen some of the services, I don't remember all that are there. You will now know for when you ever need to install again.
Re: Recommended way to disable/enable services?
Posted: Wed May 08, 2019 8:46 pm
by BV206
towwire wrote: Wed May 08, 2019 8:14 pm
Open the MX User Manual, go to Figure 2-20: Installer Screen 6. You will find a button "View" under 6d. Service Setting (advanced), if you had checked there you would have seen some of the services, I don't remember all that are there. You will now know for when you ever need to install again.
That's exactly what I was talking about earlier.
You can't disable any service you want with the installer. It has a few options but not all of the stuff I wanted disabled.
The Samba check box a few screens before the advanced screen doesn't appear to do anything.
Re: Recommended way to disable/enable services?
Posted: Thu May 09, 2019 3:39 am
by cyrilus31
Time to double check or to use bugtracker

Re: Recommended way to disable/enable services?
Posted: Thu May 09, 2019 5:54 am
by srq2625
BV206 wrote: Wed May 08, 2019 3:27 pm
bluetooth (computer doesn't have bluetooth)
saned (no scanner)
cups (no printer)
cups-browsed (no network printer)
avahi-daemon (no network printer or file server)
samba (no network file server)
nmbd (no network file server)
smbd (no network file server)
nfs-common (no network file server)
nfs-kernel-server (no network file server)
openvpn (no vpn)
pppd-dns (no dial-up modem)
ModemManager (no dial-up modem)
unattended-upgrades (I manually check for upgrades very day)
Thanks - one more thing to work on "when I have the time".
I can see where disabling some (most) of these would be a goodness in my environment; I also don't have a file server, dial-up modem, or bluetooth.
Re: Recommended way to disable/enable services?
Posted: Thu May 09, 2019 8:16 am
by dreamer
BV206 wrote: Wed May 08, 2019 8:46 pm
You can't disable any service you want with the installer. It has a few options but not all of the stuff I wanted disabled.
I don't think it's the job of the installer to enable/disable services so I don't change anything. After installation or in a live environment with persistence it's easy to make the changes you want. I recommend that you install the package bum (Boot-Up Manager). It's a GUI application that you can launch from the menu. It takes a while when you launch it for the first time. After that it's faster. It lists running (and not running) services on your system. I prefer it to the "sudo service --status-all" command. It has an Advanced checkbox that will give you some more info for example if the service is related to a deb package and the name of that deb package and a link to the service homepage where you can find more info.
"Off topic": Windows has many management GUIs (from Microsoft and third party), to the point where you hardly have to use the command line. I understand that the CLI is often faster and the way to go if you want to learn a system. But I also think a GUI can provide a better overview and give you info from several commands at the same time. Boot-Up Manager is a bit dated, but as far as I can tell it's fully functional. I hope MX devs package Boot-Up Manager for a Debian Buster based release. Since it's based on sysvinit and not systemd it's unlikely that BUM would suddenly stop working due to low-level breaking changes.