How to disable services from booting on debian

Yoplux
3 min readApr 23, 2021

--

To know wich services is running when debian is booting you can check it into /etc/init.d

root@debian:~# cd /etc/init.d/ && ls -all
total 148
drwxr-xr-x 2 root root 4096 avril 23 19:34 .
drwxr-xr-x 126 root root 12288 avril 23 21:05 ..
-rwxr-xr-x 1 root root 5336 mars 30 2019 alsa-utils
-rwxr-xr-x 1 root root 2055 mai 19 2019 anacron
-rwxr-xr-x 1 root root 3740 mars 30 2019 apparmor
-rwxr-xr-x 1 root root 2948 mars 22 2020 bluetooth
-rwxr-xr-x 1 root root 1232 août 15 2019 console-setup.sh
-rwxr-xr-x 1 root root 3059 oct. 11 2019 cron
-rwxr-xr-x 1 root root 1961 avril 10 2019 cups-browsed
-rwxr-xr-x 1 root root 2813 juil. 5 2020 dbus
-rwxr-xr-x 1 root root 3033 févr. 9 2019 gdm3
-rwxr-xr-x 1 root root 3809 janv. 10 2019 hwclock.sh
-rwxr-xr-x 1 root root 1479 oct. 10 2016 keyboard-setup.sh
-rwxr-xr-x 1 root root 2044 févr. 9 2019 kmod
-rwxr-xr-x 1 root root 4445 août 25 2018 networking
-rwxr-xr-x 1 root root 1942 oct. 4 2019 network-manager
-rwxr-xr-x 1 root root 9138 févr. 20 2019 openvpn
-rwxr-xr-x 1 root root 3720 oct. 12 2018 pcscd
-rwxr-xr-x 1 root root 1366 avril 8 2019 plymouth
-rwxr-xr-x 1 root root 752 avril 8 2019 plymouth-log
-rwxr-xr-x 1 root root 612 févr. 20 2020 pppd-dns
-rwxr-xr-x 1 root root 924 mai 31 2018 procps
-rwxr-xr-x 1 root root 2864 févr. 26 2019 rsyslog
-rwxr-xr-x 1 root root 2224 avril 15 2018 saned
-rwxr-xr-x 1 root root 1960 mai 2 2020 speech-dispatcher
-rwxr-xr-x 1 root root 1030 févr. 2 2020 sudo
-rwxr-xr-x 1 root root 6872 oct. 24 20:44 udev
-rwxr-xr-x 1 root root 2083 août 15 2017 ufw
-rwxr-xr-x 1 root root 1391 juin 8 2019 unattended-upgrades
-rwxr-xr-x 1 root root 2757 nov. 23 2016 x11-common
root@debian:/etc/init.d#

Stop one of them from booting

systemctl disable openvpn.service

This is really simple, now you know how to disable one, you can do it with with others !

List all services

systemctl --type=service

You should see this page

Get the status of a service (openvpn.service is an example)

root@debian:/etc/init.d# systemctl status openvpn.service ● openvpn.service - OpenVPN service
Loaded: loaded (/lib/systemd/system/openvpn.service; enabled; vendor preset: enabled)
Active: active (exited) since Fri 2021-04-23 21:05:06 CEST; 17min ago
Process: 563 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 563 (code=exited, status=0/SUCCESS)
avril 23 21:05:05 debian systemd[1]: Starting OpenVPN service...
avril 23 21:05:06 debian systemd[1]: Started OpenVPN service.

This one is active, this how to stop it

Stop a service

root@debian:/etc/init.d# systemctl stop openvpn.service 
root@debian:/etc/init.d#

Signed Alix.

--

--