List and edit service configuration

Services or daemons (probably the name we are more familiar with) in linux, are programms or applications, which run or expect to run in the background. In essence , they are running without the need for the user to be aware of them all the time.

Listing running services

In order to visualize the running services in our system, we can execute the following command:

$ systemctl --type=service

Which gives us (I cut it off for just diaplaying purpose):

  UNIT                                      LOAD   ACTIVE SUB     DESCRIPTION        
  alsa-restore.service                      loaded active exited  Save/Restore Sound Card State
  bolt.service                              loaded active running Thunderbolt system service
  dbus.service                              loaded active running D-Bus System Message Bus
  iio-sensor-proxy.service                  loaded active running IIO Sensor Proxy service
  NetworkManager.service                    loaded active running Network Manager
  sddm.service                              loaded active running Simple Desktop Display Manager
  systemd-journald.service                  loaded active running Journal Service
  systemd-logind.service                    loaded active running User Login Management
  [email protected]                         loaded active running User Manager for UID 1000
  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.
36 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

We also get a piece of help if we want to see the installed ones:

$ systemctl list-unit-files

Editing service configuration

Individually, per service, we can edit its configuration. In this example we are using NetworkManager.service which is one of the main ones for handling our network connection. So let’s see its configuration:

$ sudo systemctl edit --full NetworkManager.service

And the output:

Description=Network Manager
Documentation=man:NetworkManager(8) dbus.service 

#ExecReload=/bin/kill -HUP $MAINPID
ExecStart=/usr/bin/NetworkManager --no-daemon
# NM doesn't want systemd to kill its children for it


# We require file descriptors for DHCP etc. When activating many interfaces,
# the default limit of 1024 is easily reached.


# We want to enable NetworkManager-wait-online.service whenever this service
# is enabled. NetworkManager-wait-online.service has
#, so enabling it only has an effect if
# itself is enabled or pulled in by some other unit.

We edit and save, and bum!..We are done.

Extra Ball

If you are interested in knowing more about services, check: