How to List All Available Services in Linux Ubuntu 18.04

Posted on

This article will present a content about how to list all available services in Linux Ubuntu 18.04. There are several ways to display all the available linux services. But in a real case, some of those ways fails to list all services usually. In order to list all the available services, normally the way is for using several specific commands to generate the result.  The following are those commands :

1. The first one is using the ‘service’ command. The pattern for listing all available services is as follows :

service --status-all

The output of the above command exist as follows :

root@hostname ~(keystone)# systemctl -l --type service --all
  UNIT                                                  LOAD      ACTIVE   SUB     DESCRIPTION                                                                     
  accounts-daemon.service                               loaded    active   running Accounts Service                                                                
  acpid.service                                         loaded    active   running ACPI event daemon                                                               
  alsa-restore.service                                  loaded    active   exited  Save/Restore Sound Card State                                                   
  alsa-state.service                                    loaded    inactive dead    Manage Sound Card State (restore and store)                                     
  anacron.service                                       loaded    inactive dead    Run anacron jobs                                                                
● apache2.service                                       loaded    failed   failed  The Apache HTTP Server                                                          
  apparmor.service                                      loaded    active   exited  AppArmor initialization                                                         
  apport-autoreport.service                             loaded    inactive dead    Process error reports when automatic reporting is enabled                       
  apport.service                                        loaded    active   exited  LSB: automatic crash report generation                                          
  apt-daily-upgrade.service                             loaded    inactive dead    Daily apt upgrade and clean activities                                          
  apt-daily.service                                     loaded    inactive dead    Daily apt download activities                                                   
● auditd.service                                        not-found inactive dead    auditd.service                                                                  
  avahi-daemon.service                                  loaded    active   running Avahi mDNS/DNS-SD Stack                                                         
  blk-availability.service                              loaded    active   exited  Availability of block devices                                                   
  bluetooth.service                                     loaded    active   running Bluetooth service                                                               
  bolt.service                                          loaded    active   running Thunderbolt system service                                                      
  certbot.service                                       loaded    inactive dead    Certbot                                                                         
  clamav-daemon.service                                 loaded    active   running Clam AntiVirus userspace daemon                                                 
  clamav-freshclam.service                              loaded    active   running ClamAV virus database updater                                                   
  colord.service                                        loaded    active   running Manage, Install and Generate Color Profiles                                     
● connman.service                                       not-found inactive dead    connman.service                                                                 
  conntrackd.service                                    loaded    active   running Conntrack Daemon                                                                
● console-screen.service                                not-found inactive dead    console-screen.service                                                          
  console-setup.service                                 loaded    active   exited  Set console font and keymap                                                     
  containerd.service                                    loaded    active   running containerd container runtime                                                    
● cpufrequtils.service                                  not-found inactive dead    cpufrequtils.service                                                            
  cron.service                                          loaded    active   running Regular background program processing daemon                                    
  cups-browsed.service                                  loaded    active   running Make remote CUPS printers available locally                                     
  cups.service                                          loaded    active   running CUPS Scheduler                                                                  
  dbus.service                                          loaded    active   running D-Bus System Message Bus                                                        
  dm-event.service                                      loaded    inactive dead    Device-mapper event daemon                                                      
  dns-clean.service                                     loaded    inactive dead    Clean up any mess left by 0dns-up                                               
  docker.service                                        loaded    active   running Docker Application Container Engine                                             
  ebtables.service                                      loaded    active   exited  ebtables ruleset management                                                     
  emergency.service                                     loaded    inactive dead    Emergency Shell                                                                 
● exim4.service                                         not-found inactive dead    exim4.service                                                                   
  failsafe-x.service                                    loaded    inactive dead    X.org diagnosis failsafe                                                        
● fcoe.service                                          not-found inactive dead    fcoe.service                                                                    
● festival.service                                      not-found inactive dead    festival.service                                                                
● firewalld.service                                     not-found inactive dead    firewalld.service                                                               
● forticlient-scheduler.service                         masked    inactive dead    forticlient-scheduler.service                                                   
  fstrim.service                                        loaded    inactive dead    Discard unused blocks                                                           
  fwupd.service                                         loaded    active   running Firmware update daemon                                                          
  gdm.service                                           loaded    active   running GNOME Display Manager                                                           
  getty-static.service                                  loaded    inactive dead    getty on tty2-tty6 if dbus and logind are not available                         
  getty@tty1.service                                    loaded    inactive dead    Getty on tty1                                                                   
  gitlab-runsvdir.service                               loaded    active   running GitLab Runit supervision process                                                
  glance-api.service                                    loaded    active   running OpenStack Image Service API                                                     
  gpu-manager.service                                   loaded    inactive dead    Detect the available GPUs and deal with any system changes                      
  grafana-server.service                                loaded    active   running Grafana instance                                                                
lines 1-52

The above output is just an example and it doesn’t display all of the services in one page. In the above output, there is an additional information about the service, the status and also a short information about what the service is actually does. This command, the systemctl command is a proper one to use. The output in the above might different where it is actually depends on the environment and also the available services exist in it. Furthremore, the command systemctl should yield good results with list-units option. Some extra parameters are added, which are self explainable. The above systemctl command execution can have another pattern to display it in a different form. The following is another pattern for the same command with a different parameters :

systemctl list-units --all --type=service --no-pager

Just execute the above pattern command, and the following output will appear :

root@hostname:~$ systemctl list-units --all --type=service --no-pager
  UNIT                                                  LOAD      ACTIVE   SUB     DESCRIPTION                                                                     
  accounts-daemon.service                               loaded    active   running Accounts Service                                                                
  acpid.service                                         loaded    active   running ACPI event daemon                                                               
  alsa-restore.service                                  loaded    active   exited  Save/Restore Sound Card State                                                   
  alsa-state.service                                    loaded    inactive dead    Manage Sound Card State (restore and store)                                     
  anacron.service                                       loaded    inactive dead    Run anacron jobs                                                                
  apache2.service                                       loaded    active   running The Apache HTTP Server                                                          
  apparmor.service                                      loaded    active   exited  AppArmor initialization                                                         
  apport-autoreport.service                             loaded    inactive dead    Process error reports when automatic reporting is enabled                       
  apport.service                                        loaded    active   exited  LSB: automatic crash report generation                                          
  apt-daily-upgrade.service                             loaded    inactive dead    Daily apt upgrade and clean activities                                          
  apt-daily.service                                     loaded    inactive dead    Daily apt download activities                                                   
● auditd.service                                        not-found inactive dead    auditd.service                                                                  
  avahi-daemon.service                                  loaded    active   running Avahi mDNS/DNS-SD Stack                                                         
  blk-availability.service                              loaded    active   exited  Availability of block devices                                                   
  bluetooth.service                                     loaded    active   running Bluetooth service                                                               
  bolt.service                                          loaded    active   running Thunderbolt system service                                                      
  certbot.service                                       loaded    inactive dead    Certbot                                                                         
  clamav-daemon.service                                 loaded    active   running Clam AntiVirus userspace daemon                                                 
  clamav-freshclam.service                              loaded    active   running ClamAV virus database updater                                                                                   
  colord.service                                        loaded    active   running Manage, Install and Generate Color Profiles                                     
● connman.service                                       not-found inactive dead    connman.service                                                                 
  conntrackd.service                                    loaded    active   running Conntrack Daemon                                                                
● console-screen.service                                not-found inactive dead    console-screen.service                                                          
  console-setup.service                                 loaded    active   exited  Set console font and keymap                                                     
  containerd.service                                    loaded    active   running containerd container runtime                                                    
● cpufrequtils.service                                  not-found inactive dead    cpufrequtils.service                                                            
  cron.service                                          loaded    active   running Regular background program processing daemon                                    
  cups-browsed.service                                  loaded    active   running Make remote CUPS printers available locally                                     
  cups.service                                          loaded    active   running CUPS Scheduler                                                                  
  dbus.service                                          loaded    active   running D-Bus System Message Bus                                                        
  dm-event.service                                      loaded    inactive dead    Device-mapper event daemon                                                      
  dns-clean.service                                     loaded    inactive dead    Clean up any mess left by 0dns-up                                               
  docker.service                                        loaded    active   running Docker Application Container Engine                                             
  ebtables.service                                      loaded    active   exited  ebtables ruleset management                                                     
  emergency.service                                     loaded    inactive dead    Emergency Shell                                                                 
● exim4.service                                         not-found inactive dead    exim4.service                                                                   
  failsafe-x.service                                    loaded    inactive dead    X.org diagnosis failsafe                                                        
● fcoe.service                                          not-found inactive dead    fcoe.service                                                                    
● festival.service                                      not-found inactive dead    festival.service                                                                
● firewalld.service                                     not-found inactive dead    firewalld.service                                                               
● forticlient-scheduler.service                         masked    inactive dead    forticlient-scheduler.service                                                   
  fstrim.service                                        loaded    inactive dead    Discard unused blocks                                                           
  fwupd.service                                         loaded    active   running Firmware update daemon                                                          
  gdm.service                                           loaded    active   running GNOME Display Manager                                                           
  getty-static.service                                  loaded    inactive dead    getty on tty2-tty6 if dbus and logind are not available                         
  getty@tty1.service                                    loaded    inactive dead    Getty on tty1                                                                   
  gitlab-runsvdir.service                               loaded    active   running GitLab Runit supervision process                                                
  glance-api.service                                    loaded    active   running OpenStack Image Service API                                                     
  gpu-manager.service                                   loaded    inactive dead    Detect the available GPUs and deal with any system changes                      
  grafana-server.service                                loaded    active   running Grafana instance                                                                
  grub-common.service                                   loaded    active   exited  LSB: Record successful boot for GRUB                                            
  haproxy.service                                       loaded    active   running HAProxy Load Balancer                                                           
  hddtemp.service                                       loaded    active   exited  LSB: disk temperature monitoring daemon                                         
  ipvsadm.service                                       loaded    active   exited  LSB: ipvsadm daemon                                                             
  irqbalance.service                                    loaded    active   running irqbalance daemon                                                               
● iscsi-shutdown.service                                not-found inactive dead    iscsi-shutdown.service                                                          
  iscsid.service                                        loaded    inactive dead    iSCSI initiator daemon (iscsid)                                                 
● kbd.service                                           not-found inactive dead    kbd.service                                                                     
  keepalived.service                                    loaded    inactive dead    Keepalive Daemon (LVS and VRRP)                                                 
  kerneloops.service                                    loaded    active   running Tool to automatically collect and submit kernel crash signatures                
  keyboard-setup.service                                loaded    active   exited  Set the console keyboard layout                                                 
● keystone.service                                      not-found inactive dead    keystone.service                                                                
  kmod-static-nodes.service                             loaded    active   exited  Create list of required static device nodes for the current kernel              
  libvirt-guests.service                                loaded    active   exited  Suspend/Resume Running libvirt Guests                                           
  libvirtd.service                                      loaded    active   running Virtualization daemon                                                           
  lm-sensors.service                                    loaded    active   exited  Initialize hardware monitoring sensors                                          
● lvm2-activation.service                               not-found inactive dead    lvm2-activation.service                                                         
  lvm2-lvmetad.service                                  loaded    active   running LVM2 metadata daemon                                                            
  lvm2-lvmpolld.service                                 loaded    inactive dead    LVM2 poll daemon                                                                
  lvm2-monitor.service                                  loaded    active   exited  Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling   
  mariadb.service                                       loaded    active   running MariaDB 10.1.40 database server                                                 
  memcached.service                                     loaded    active   running memcached daemon                                                                
  ModemManager.service                                  loaded    active   running Modem Manager                                                                   
  motd-news.service                                     loaded    inactive dead    Message of the Day                                                              
● mountkernfs.service                                   masked    inactive dead    mountkernfs.service                                                             
  mssql-server.service                                  loaded    active   running Microsoft SQL Server Database Engine                                            
  networkd-dispatcher.service                           loaded    active   running Dispatcher daemon for systemd-networkd                                          
  networking.service                                    loaded    active   exited  Raise network interfaces                                                        
  NetworkManager-wait-online.service                    loaded    active   exited  Network Manager Wait Online                                                     
  NetworkManager.service                                loaded    active   running Network Manager                                                                 
● neutron-ovs-cleanup.service                           not-found inactive dead    neutron-ovs-cleanup.service                                                     
  nmbd.service                                          loaded    active   running Samba NMB Daemon                                                                
● nova-api.service                                      masked    inactive dead    nova-api.service                                                                
  nova-compute.service                                  loaded    active   running OpenStack Compute                                                               
● nova-conductor.service                                masked    inactive dead    nova-conductor.service                                                          
● nova-consoleauth.service                              masked    inactive dead    nova-consoleauth.service                                                        
● nova-novncproxy.service                               masked    inactive dead    nova-novncproxy.service                                                         
● nova-scheduler.service                                masked    inactive dead    nova-scheduler.service                                                          
  ntp-systemd-netif.service                             loaded    inactive dead    ntp-systemd-netif.service                                                       
  ntp.service                                           loaded    inactive dead    Network Time Service                                                            
● oem-config.service                                    not-found inactive dead    oem-config.service                                                              
  ondemand.service                                      loaded    inactive dead    Set the CPU Frequency Scaling governor                                          
  open-iscsi.service                                    loaded    inactive dead    Login to default iSCSI targets                                                  
  packagekit.service                                    loaded    active   running PackageKit Daemon                                                               
  phpsessionclean.service                               loaded    inactive dead    Clean php session files                                                         
  plymouth-quit-wait.service                            loaded    inactive dead    Hold until boot process finishes up                                             
  plymouth-quit.service                                 loaded    inactive dead    Terminate Plymouth Boot Screen                                                  
  plymouth-read-write.service                           loaded    inactive dead    Tell Plymouth To Write Out Runtime Data                                         
  plymouth-start.service                                loaded    inactive dead    Show Plymouth Boot Screen                                                       
  polkit.service                                        loaded    active   running Authorization Manager                                                           
  postfix.service                                       loaded    active   exited  Postfix Mail Transport Agent                                                    
  postfix@-.service                                     loaded    active   running Postfix Mail Transport Agent (instance -)                                       
  postgresql.service                                    loaded    active   exited  PostgreSQL RDBMS                                                                
● postgresql@10-main.service                            loaded    failed   failed  PostgreSQL Cluster 10-main                                                      
  pppd-dns.service                                      loaded    inactive dead    Restore /etc/resolv.conf if the system crashed before the ppp link was shut down
  prometheus-node-exporter.service                      loaded    active   running Prometheus exporter for machine metrics                                         
  prometheus.service                                    loaded    active   running Monitoring system and time series database                                      
  qemu-kvm.service                                      loaded    active   exited  QEMU KVM preparation - module, ksm, hugepages                                   
● rabbitmq-server.service                               loaded    failed   failed  RabbitMQ Messaging Server                                                       
  rc-local.service                                      loaded    inactive dead    /etc/rc.local Compatibility                                                     
  rescue.service                                        loaded    inactive dead    Rescue Shell                                                                    
  resolvconf-pull-resolved.service                      loaded    inactive dead    resolvconf-pull-resolved.service                                                
  resolvconf.service                                    loaded    active   exited  Nameserver information manager                                                  
  rsync.service                                         loaded    inactive dead    fast remote file copy program daemon                                            
  rsyslog.service                                       loaded    active   running System Logging Service                                                          
  rtkit-daemon.service                                  loaded    active   running RealtimeKit Scheduling Policy Service                                           
● sdkserver.service                                     loaded    failed   failed  zVM SDK API server                                                              
● sendmail.service                                      not-found inactive dead    sendmail.service                                                                
  setvtrgb.service                                      loaded    active   exited  Set console scheme                                                              
  smbd.service                                          loaded    active   running Samba SMB Daemon                                                                
  snap.lxd.activate.service                             loaded    inactive dead    Service for snap application lxd.activate                                       
  snap.lxd.daemon.service                               loaded    active   running Service for snap application lxd.daemon                                         
  snapd.autoimport.service                              loaded    inactive dead    Auto import assertions from block devices                                       
  snapd.core-fixup.service                              loaded    inactive dead    Automatically repair incorrect owner/permissions on core devices                
  snapd.failure.service                                 loaded    inactive dead    Failure handling of the snapd snap                                              
  snapd.seeded.service                                  loaded    active   exited  Wait until snapd is fully seeded                                                
  snapd.service                                         loaded    active   running Snappy daemon                                                                   
  snapd.snap-repair.service                             loaded    inactive dead    Automatically fetch and run repair assertions                                   
  speech-dispatcher.service                             loaded    active   exited  LSB: Speech Dispatcher                                                          
  ssh.service                                           loaded    active   running OpenBSD Secure Shell server                                                     
● sssd.service                                          not-found inactive dead    sssd.service                                                                    
  sysfsutils.service                                    loaded    active   exited  LSB: Set sysfs variables from /etc/sysfs.conf                                   
  sysstat.service                                       loaded    active   exited  Resets System Activity Data Collector                                           
  systemd-ask-password-console.service                  loaded    inactive dead    Dispatch Password Requests to Console                                           
  systemd-ask-password-plymouth.service                 loaded    inactive dead    Forward Password Requests to Plymouth                                           
  systemd-ask-password-wall.service                     loaded    inactive dead    Forward Password Requests to Wall                                               
  systemd-backlight@backlight:intel_backlight.service   loaded    active   exited  Load/Save Screen Backlight Brightness of backlight:intel_backlight              
  systemd-backlight@leds:tpacpi::kbd_backlight.service  loaded    active   exited  Load/Save Screen Backlight Brightness of leds:tpacpi::kbd_backlight             
  systemd-binfmt.service                                loaded    inactive dead    Set Up Additional Binary Formats                                                
  systemd-fsck-root.service                             loaded    inactive dead    File System Check on Root Device                                                
  systemd-fsck@dev-disk-by\x2duuid-B2FD\x2dE3BB.service loaded    active   exited  File System Check on /dev/disk/by-uuid/B2FD-E3BB                                
  systemd-fsckd.service                                 loaded    inactive dead    File System Check Daemon to report status                                       
  systemd-hwdb-update.service                           loaded    inactive dead    Rebuild Hardware Database                                                       
  systemd-initctl.service                               loaded    inactive dead    /dev/initctl Compatibility Daemon                                               
  systemd-journal-flush.service                         loaded    active   exited  Flush Journal to Persistent Storage                                             
  systemd-journald.service                              loaded    active   running Journal Service                                                                 
  systemd-logind.service                                loaded    active   running Login Service                                                                   
  systemd-machine-id-commit.service                     loaded    inactive dead    Commit a transient machine-id on disk                                           
● systemd-machined.service                              not-found inactive dead    systemd-machined.service                                                        
  systemd-modules-load.service                          loaded    active   exited  Load Kernel Modules                                                             
  systemd-networkd.service                              loaded    inactive dead    Network Service                                                                 
  systemd-quotacheck.service                            loaded    inactive dead    File System Quota Check                                                         
  systemd-random-seed.service                           loaded    active   exited  Load/Save Random Seed                                                           
  systemd-remount-fs.service                            loaded    active   exited  Remount Root and Kernel File Systems                                            
  systemd-resolved.service                              loaded    active   running Network Name Resolution                                                         
  systemd-rfkill.service                                loaded    inactive dead    Load/Save RF Kill Switch Status                                                 
  systemd-sysctl.service                                loaded    active   exited  Apply Kernel Variables                                                          
● systemd-sysusers.service                              not-found inactive dead    systemd-sysusers.service                                                        
  systemd-timesyncd.service                             loaded    active   running Network Time Synchronization                                                    
  systemd-tmpfiles-clean.service                        loaded    inactive dead    Cleanup of Temporary Directories                                                
  systemd-tmpfiles-setup-dev.service                    loaded    active   exited  Create Static Device Nodes in /dev                                              
  systemd-tmpfiles-setup.service                        loaded    active   exited  Create Volatile Files and Directories                                           
  systemd-udev-trigger.service                          loaded    active   exited  udev Coldplug all Devices                                                       
  systemd-udevd.service                                 loaded    active   running udev Kernel Device Manager                                                      
● systemd-update-done.service                           not-found inactive dead    systemd-update-done.service                                                     
  systemd-update-utmp-runlevel.service                  loaded    inactive dead    Update UTMP about System Runlevel Changes                                       
  systemd-update-utmp.service                           loaded    active   exited  Update UTMP about System Boot/Shutdown                                          
  systemd-user-sessions.service                         loaded    active   exited  Permit User Sessions                                                            
● systemd-vconsole-setup.service                        not-found inactive dead    systemd-vconsole-setup.service                                                  
  thermald.service                                      loaded    active   running Thermal Daemon Service                                                          
  tuptime.service                                       loaded    active   exited  Tuptime service                                                                 
  udisks2.service                                       loaded    active   running Disk Manager                                                                    
  ufw.service                                           loaded    active   exited  Uncomplicated firewall                                                          
  unattended-upgrades.service                           loaded    active   running Unattended Upgrades Shutdown                                                    
  upower.service                                        loaded    active   running Daemon for power management                                                     
  ureadahead-stop.service                               loaded    inactive dead    Stop ureadahead data collection                                                 
  ureadahead.service                                    loaded    inactive dead    Read required files in advance                                                  
  user@1000.service                                     loaded    active   running User Manager for UID 1000                                                       
  user@122.service                                      loaded    active   running User Manager for UID 122                                                        
  uuidd.service                                         loaded    inactive dead    Daemon for generating UUIDs                                                     
  virtlockd.service                                     loaded    inactive dead    Virtual machine lock manager                                                    
  virtlogd.service                                      loaded    inactive dead    Virtual machine log manager                                                     
  virtualbox.service                                    loaded    active   exited  LSB: VirtualBox Linux kernel module                                             
  whoopsie.service                                      loaded    active   running crash report submission daemon                                                  
● winbind.service                                       not-found inactive dead    winbind.service                                                                 
  wpa_supplicant.service                                loaded    active   running WPA supplicant                                                                  

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

187 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
(base) root@hostname:~$


2. There is another command for listing or displaying the complete list of available services in the operating system. The following is the command pattern :

service --status all

Below is the example of the above command execution :

root@hostname:~$ service --status-all
 [ + ]  acpid
 [ - ]  alsa-utils
 [ - ]  anacron
 [ + ]  apache-htcacheclean
 [ + ]  apache2
 [ + ]  apparmor
 [ + ]  apport
 [ + ]  avahi-daemon
 [ + ]  bluetooth
 [ - ]  brltty
 [ - ]  cgroupfs-mount
 [ + ]  clamav-daemon
 [ + ]  clamav-freshclam
 [ + ]  conntrackd
 [ - ]  console-setup.sh
 [ + ]  cron
 [ - ]  cryptdisks
 [ - ]  cryptdisks-early
 [ + ]  cups
 [ + ]  cups-browsed
 [ + ]  dbus
 [ - ]  dns-clean
 [ + ]  docker
 [ + ]  ebtables
 [ + ]  gdm3
 [ + ]  glance-api
 [ + ]  grafana-server
 [ + ]  grub-common
 [ + ]  haproxy
 [ + ]  hddtemp
 [ - ]  hwclock.sh
 [ + ]  ipvsadm
 [ + ]  irqbalance
 [ + ]  iscsid
 [ ? ]  jira
 [ - ]  keepalived
 [ + ]  kerneloops
 [ - ]  keyboard-setup.sh
 [ + ]  kmod
 [ + ]  libvirt-guests
 [ - ]  lightdm
 [ + ]  lm-sensors
 [ - ]  lvm2
 [ + ]  lvm2-lvmetad
 [ + ]  lvm2-lvmpolld
 [ - ]  mdadm
 [ - ]  mdadm-waitidle
 [ + ]  memcached
 [ + ]  mysql
 [ + ]  network-manager
 [ + ]  networking
 [ + ]  nmbd
 [ - ]  nova-api
 [ + ]  nova-compute
 [ - ]  nova-conductor
 [ - ]  nova-consoleauth
 [ - ]  nova-novncproxy
 [ - ]  nova-scheduler
 [ - ]  ntp
 [ - ]  open-iscsi
 [ - ]  plymouth
 [ - ]  plymouth-log
 [ + ]  postfix
 [ + ]  postgresql
 ...

In the generated output command above, there are three types of services available. Those types are :

    [ + ] this sign is for the running services
    [ - ] this sign is for stopped services
    [ ? ] this sign is for services without a 'status' command

In the above output, every service has its own label for the service name.

Leave a Reply