🐧 How to list services that start at boot on Linux

By default, some important system services start automatically when the system boots. For example, the NetworkManager and Firewalld services will automatically start at system boot. Startup services are also known as daemons on Linux and Unix-like operating systems. They will continue to run in the background and do their job without user intervention. In addition to system services, some other third-party applications will be added to startup. In this quick tutorial, let’s see how to find and list startup services at boot time on Linux and Unix-like systems.

List of autostart services at boot in Linux

The list of startup services depends on the init system.

Systemd is the default init system for major newer versions of Linux distributions.

If your systems are running the systemd system manager, you can list all the services with the following command:

$ sudo systemctl list-unit-files --type=service

Output example:

UNIT FILE                                  STATE           VENDOR PRESET
accounts-daemon.service                    enabled         enabled      
acpid.service                              disabled        enabled      
alsa-restore.service                       static          enabled      
alsa-state.service                         static          enabled      
alsa-utils.service                         masked          enabled      
anacron.service                            enabled         enabled      
apparmor.service                           enabled         enabled      
apport-autoreport.service                  static          enabled      
[email protected]                    static          enabled      
apport.service                             generated       enabled      
.
.
.
[email protected]                 static          enabled      
whoopsie.service                           disabled        enabled      
[email protected]            disabled        enabled      
[email protected]              disabled        enabled      
wpa_supplicant.service                     enabled         enabled      
[email protected]                    disabled        enabled      
x11-common.service                         masked          enabled      
[email protected]                         static          enabled      
xfs_scrub_all.service                      static          enabled      
[email protected]                    static          enabled      

265 unit files listed.

🐧 How to list services that start at boot on Linux

As stated above, this command shows a list of all services (both enabled and disabled at system boot) on your Linux system.

You can check this by looking at the STATE section in the above output.

Services that start at boot are marked as enabledand services that fail to start are marked as disabled

To list only the enabled services when the system boots, run:

$ sudo systemctl list-unit-files --type=service --state=enabled --all

Output example:

UNIT FILE                                  STATE   VENDOR PRESET
accounts-daemon.service                    enabled enabled      
anacron.service                            enabled enabled      
apparmor.service                           enabled enabled      
[email protected]                            enabled enabled      
avahi-daemon.service                       enabled enabled      
.
.
.
udisks2.service                            enabled enabled      
ufw.service                                enabled enabled      
unattended-upgrades.service                enabled enabled      
vboxweb.service                            enabled enabled      
wpa_supplicant.service                     enabled enabled      

74 unit files listed.

To list all disabled services at system boot, run:

$ sudo systemctl list-unit-files --type=service --state=disabled --all

As I said, some older Linux distributions may use SysV or Upstart as their default init system. If your system uses sysv, run the following command to list all services:

$ sudo service --status-all

Output example:

[ + ]  acpid
 [ - ]  alsa-utils
 [ - ]  anacron
 [ + ]  apparmor
 [ + ]  apport
 [ + ]  avahi-daemon
 [ + ]  bluetooth
 [ - ]  console-setup.sh
 [ + ]  cron
 [ - ]  cryptdisks
 [ - ]  cryptdisks-early
 [ + ]  cups
 [ + ]  cups-browsed
 [ + ]  dbus
 [ - ]  dns-clean
 [ + ]  dnsmasq
 [ + ]  exim4
 [ + ]  gdm3
 [ + ]  grub-common
 [ + ]  hddtemp
 [ - ]  hwclock.sh
 [ + ]  irqbalance
 [ + ]  kerneloops
 [ - ]  keyboard-setup.sh
 [ + ]  kmod
 [ + ]  lm-sensors
 [ - ]  lvm2
 [ - ]  lvm2-lvmpolld
 [ + ]  network-manager
 [ + ]  networking
 [ + ]  openvpn
 [ - ]  plymouth
 [ - ]  plymouth-log
 [ - ]  pppd-dns
 [ + ]  procps
 [ - ]  pulseaudio-enable-autospawn
 [ - ]  rsync
 [ + ]  rsyslog
 [ - ]  saned
 [ - ]  screen-cleanup
 [ + ]  smartmontools
 [ - ]  speech-dispatcher
 [ - ]  spice-vdagent
 [ + ]  sysstat
 [ + ]  udev
 [ + ]  ufw
 [ + ]  unattended-upgrades
 [ - ]  uuidd
 [ + ]  virtualbox
 [ - ]  whoopsie
 [ - ]  x11-common

Here, + indicates that the service is running and – indicates a stopped service. To list all services that are enabled at boot run:

$ sudo chkconfig --list

This command will display the status of each service at each runlevel.

An example of the output of the above command would be like this:

acpid           0:off   1:off   2:on    3:on    4:on    5:on    6:off
anamon          0:off   1:off   2:off   3:off   4:off   5:off   6:off
atd             0:off   1:off   2:off   3:on    4:on    5:on    6:off
[...]

In the above command, “on” means that the service is started at boot.

You can also view the status of a specific service at different runlevels as shown below:

$ sudo chkconfig --list httpd

If your Linux system uses upstart, run this command to list all startup services:

$ sudo initctl list

The above command will show all tasks Session

If you want to show everything System tasks, run:

$ sudo initctl --system list

To list all services and show their statuses at each runlevel, run:

$ sudo initctl list | awk '{ print $1 }' | xargs -n1 initctl show-config

To show the status of a specific service, run this command:

$ initctl show-config <service_name>

Disable services at system startup

The more applications you install on your computer, the longer it will take for your system to boot.

To reduce the boot time of your Linux system, you need to find unnecessary services and disable them.

Let’s say, for example, if you don’t want the unattended-upgradedes.service to be loaded on OS startup, you can disable it with the command:

$ sudo systemctl disable --now unattended-upgrades.service

To see if a service is enabled at boot time, run:

$ sudo systemctl is-enabled <service-name>

Sidebar