Home Linux Basics How To List Startup Services At Boot In Linux

How To List Startup Services At Boot In Linux

By sk
Published: Updated: 61.2K views

By default, some important system services are started automatically when the system boots. For instance, the NetworkManager and Firewalld services will be automatically started at system boot. The startup services are also known as daemons in Linux and Unix-like operating systems. They will keep running in the background and do their job without any user intervention. In addition to the system services, some other third-party applications will also add themselves to the startup. In this brief guide, let us see how to find and list startup services at boot time in Linux and Unix-like systems.

List Startup Services At Boot In Linux

Finding the list of startup services will differ depending upon the init system. Systemd is the default init system for the major newer versions of Linux distributions.

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

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

Sample output:

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      
apport-forward@.service                    static          enabled      
apport.service                             generated       enabled      
.
.
.
wacom-inputattach@.service                 static          enabled      
whoopsie.service                           disabled        enabled      
wpa_supplicant-nl80211@.service            disabled        enabled      
wpa_supplicant-wired@.service              disabled        enabled      
wpa_supplicant.service                     enabled         enabled      
wpa_supplicant@.service                    disabled        enabled      
x11-common.service                         masked          enabled      
xfs_scrub@.service                         static          enabled      
xfs_scrub_all.service                      static          enabled      
xfs_scrub_fail@.service                    static          enabled      

265 unit files listed.
List all services in Linux with systemd
List all services in Linux with systemd

As stated above, this command shows the list of all services (both enabled and disabled at system boot) in your Linux system. You can verify it by looking under the STATE section in the above output. The services that are started at boot are marked as enabled, and the services that are not started are marked as disabled.

View Only Enabled Services

To list only the enabled services at system boot, run:

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

Sample output:

UNIT FILE                                  STATE   VENDOR PRESET
accounts-daemon.service                    enabled enabled      
anacron.service                            enabled enabled      
apparmor.service                           enabled enabled      
autovt@.service                            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.

Find Disabled Services

To list all disabled services at system boot, run:

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

Like I already said, some older Linux distributions may use either 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

Sample output:

 [ + ]  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, the + indicates the service is running, and - indicates a stopped service. If you see ? in the output, the service state cannot be determined (for some reason).

To list all services which are enabled at boot, run:

$ sudo chkconfig --list

This command will list status of each service on each run level. A sample output of the above command will be:

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 the service is started at boot.

View Status Of Services

You can also view the status of a specific service at different run level like below:

$ sudo chkconfig --list httpd

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

$ sudo initctl list

The above command will show all Session jobs.

If you want to show all System jobs, run:

$ sudo initctl --system list

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

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

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

$ initctl show-config <service_name>

Disable Startup Services In Linux

The more applications you install on your computer, the longer it takes for your system to boot. In order to improve your Linux system's boot time, you need to find the unnecessary services and disable them.

Say for example, if you don't want a service called unattended-upgrades.service to load at startup, you can disable it using command:

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

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

$ sudo systemctl is-enabled <service-name>

Related Read:

You May Also Like

1 comment

Alex Borrell September 4, 2020 - 10:40 pm

Very helpfull, thanks

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More