GrabDuck

How to check what services are enabled on boot in Linux - Xmodulo

:

There are so-called startup services in Linux which are set to launch automatically when a Linux system boots up. Such startup services include basic system configurations (e.g., networking, security modules, hardware peripherals), as well as various add-on services (e.g., NFS, MySQL, VPN, rsync), which all are needed for a particular Linux system to operate as expected.

In this post, I will describe how to check what startup services are enabled on boot in Linux.

Check startup services in Ubuntu or Debian

1. rcconf

A command-line utility called rcconf is a runlevel configuration tool for Debian-based systems. Using rcconf, you can check a list of available startup scripts/services, and enable/disable a particular service as you wish.

To install and start rcconf on Ubuntu or Debian:

$ sudo apt-get install rcconf
$ sudo rcconf

On Ubuntu, run the following command in addition, if you see an error saying "rcconf needs dialog or whiptail."

$ sudo ln -s /bin/whiptail /usr/bin/whiptail

Screenshot of rcconf:

2. sysv-rc-conf

sysv-rc-conf is another runlevel configuration tool for Debian-based systems.

To install and launch sysv-rc-conf on Ubuntu or Debian:

$ sudo apt-get install sysv-rc-conf
$ sudo sysv-rc-conf

Screenshot of sysv-rc-conf:

3. bum

If you are using Debian/Ubuntu desktop system, you can use bum (Boot-Up Manager), a GUI-based runlevel configuration tool.

To install and launch bum:

$ sudo apt-get install bum
$ sudo bum

Screenshot of bum:

Check startup services in CentOS, Fedora or RHEL

1. ntsysv

In RedHat-based systems, you can use ntsysv, an ncurses-based utility, to find and configure startup services.

To install and launch ntsysv on CentOS, Fedora or RHEL:

$ sudo yum install ntsysv
$ sudo ntsysv

Optionally, you can specify one or more runlevels with "--level" option in order to check particular runlevel(s). For example, to check runlevels 3, 4, and 5:

$ sudo ntsysv --level 345

Screenshot of ntsysv:

2. system-config-services

If you are using RedHat-based desktop system, you can use a GUI program called system-config-services.

To install and launch system-config-services on RedHat-based systems:

$ sudo yum install system-config-services
$ system-config-services

Screenshot of system-config-services:

3. chkconfig

A built-in system command called chkconfig can also show you startup services that are available on RedHat-based systems. To find a list of currently active startup services, run the following:

$ chkconfig --list | grep $(runlevel | awk '{ print $2 }'):on

NetworkManager 	0:off	1:off	2:on	3:on	4:on	5:on	6:off
atd            	0:off	1:off	2:off	3:on	4:on	5:on	6:off
auditd         	0:off	1:off	2:on	3:on	4:on	5:on	6:off
crond          	0:off	1:off	2:on	3:on	4:on	5:on	6:off
cups           	0:off	1:off	2:on	3:on	4:on	5:on	6:off
iptables       	0:off	1:off	2:on	3:on	4:on	5:on	6:off
lvm2-monitor   	0:off	1:on	2:on	3:on	4:on	5:on	6:off
mdmonitor      	0:off	1:off	2:on	3:on	4:on	5:on	6:off
messagebus     	0:off	1:off	2:on	3:on	4:on	5:on	6:off
netfs          	0:off	1:off	2:off	3:on	4:on	5:on	6:off
network        	0:off	1:off	2:on	3:on	4:on	5:on	6:off
portreserve    	0:off	1:off	2:on	3:on	4:on	5:on	6:off
postfix        	0:off	1:off	2:on	3:on	4:on	5:on	6:off
rsyslog        	0:off	1:off	2:on	3:on	4:on	5:on	6:off
sshd           	0:off	1:off	2:on	3:on	4:on	5:on	6:off
udev-post      	0:off	1:on	2:on	3:on	4:on	5:on	6:off

Note that on Fedora, chkconfig output does not include native systemd services (e.g., NetworkManager), since configuration of systemd services is done separately.