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
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)
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
Runtime Level | Usage | Target |
---|---|---|
0 | Shutdown the System | poweroff.target |
1 | Single User Mode (Maintenance & Repair) | rescue.target |
2 | Multi User Mode with no NFS | multi-user.target |
3 | Multi User Mode with command line | multi-user.target |
4 | Multi User Mode (User Definable) | multi-user.target |
5 | Multi User Mode with GUI | graphical.target |
6 | Restart the OS | restart.target |