Process is the running instance of an executable program
Daemon is a process that runs in the background and is not interactive
Daemons are called as Services on Windows

Services on the system are managed using a Service Manager (Systemd)
Systemd is the first process started by the kernel and has PID 1
The first process that starts on the system is called as the Init process
Each service in systemd is managed/ created using a file called Unit

systemctl <operation> <service-name>

Supported Operations

  • start/ stop/ kill
  • enable/ disable (Enable allows a service to start on boot)
  • status
  • is-active/ is-enabled (View status as a one-liner)
  • restart/ reload (Restart service. Reload is not supported by all service)
  • mask/ unmask (Prevent daemon from starting up using mask)
# Only show units that are parsed/ loaded
systemctl list-unit-files | grep enabled
systemctl list-units
systemctl list-dependencies
 
# View Logs generated by systemd
journalctl -xe

Runlevels

Runlevels are used to represent a states of the system
They are group of units that need to be started in order to be in a particular state
The “multi-user.target” is an state the system has to be in for user to login and use the system

# Switch to a different runtime level
systemctl isolate rescue.target
Runtime LevelUsageTarget
0Shutdown the Systempoweroff.target
1Single User Mode (Maintenance & Repair)rescue.target
2Multi User Mode with no NFSmulti-user.target
3Multi User Mode with command linemulti-user.target
4Multi User Mode (User Definable)multi-user.target
5Multi User Mode with GUIgraphical.target
6Restart the OSrestart.target