Professional Documents
Culture Documents
Controlling Services and Daemons: Active - All - State Load Active SUB
Controlling Services and Daemons: Active - All - State Load Active SUB
By default, the systemctl list-units --type=service command lists only the service units with active
activation states. The --all option lists all service units regardless of the activation states. Use the
--state= option to filter by the values in the LOAD, ACTIVE, or SUB fields.
The systemctl command without any arguments lists units that are both loaded and active.
systemctl
The systemctl list-units command displays units that the systemd service attempts to parse
and load into memory; it does not display installed, but not enabled, services. To see the state
of all unit files installed, use the systemctl list-unit-files command. For example:
To verify whether the unit failed during startup, run the following command:
ps -p 680
The systemd service looks for .service files for service management in commands in the absence
of the service type with the service name. Thus the above command can be executed as:
During a restart of a running service, the service is stopped and then started. On the restart of
service, the process ID changes and a new process ID gets associated during the startup.
Some services have the ability to reload their configuration files without requiring a restart. This
process is called a service reload. Reloading a service does not change the process ID associated with
various service processes.
Masking a service prevents an administrator from accidentally starting a service that conflicts with
others. Masking creates a link in the configuration directories to the /dev/null file which prevents
the service from starting.
Removed /etc/systemd/system/sendmail.service.
Removed /etc/systemd/system/multi-user.target.wants/sshd.service.
Task Command
View detailed information about a unit state. systemctl status UNIT
Stop a service on a running system. systemctl stop UNIT
Start a service on a running system. systemctl start UNIT
Restart a service on a running system. systemctl restart UNIT
Reload the configuration file of a running service. systemctl reload UNIT
Completely disable a service from being started, both
systemctl mask UNIT
manually and at boot.
Make a masked service available. systemctl unmask UNIT
Configure a service to start at boot time. systemctl enable UNIT
Disable a service from starting at boot time. systemctl disable UNIT
List units required and wanted by the specified unit. systemctl list-dependencies
UNIT