Starting and stopping systemd services
1 Environment #
This document applies to the following products and product versions:
SUSE Linux Enterprise Server 15 SP3, 15 SP2, 15 SP1, 15 GA, 12 SP5, 12 SP4, 12 SP3
SUSE Linux Enterprise Server for SAP Applications 15 SP3, 15 SP2, 15 SP1, 15 GA, 12 SP5, 12 SP4, 12 SP3
SUSE Linux Enterprise High Availability Extension 15 SP3, 15 SP2, 15 SP1, 15 GA, 12 SP5, 12 SP4, 12 SP3
SUSE Linux Enterprise High Performance Computing 15 SP3, 15 SP2, 15 SP1, 15 GA
SUSE Linux Enterprise Desktop 15 SP3, 15 SP2, 15 SP1, 15 GA, 12 SP5, 12 SP4, 12 SP3
SUSE Linux Enterprise Real Time 15 SP3, 15 SP2, 15 SP1, 15 GA, 12 SP5, 12 SP4, 12 SP3
2 Starting and stopping services with systemctl #
systemctl
is the systemd
command for managing
services. The syntax for starting and stopping services
manually is as follows:
systemctl start|stop|restart|try-restart|reload|reload-or-restart SERVICE-NAME
You can manage multiple services at once, for example, start two services:
systemctl start SERVICE-NAME1 SERVICE-NAME2
It is a best practice to use systemctl
to stop
services, rather than the ps
command. A systemd
service can include commands, processes, and dependencies.
ps
operates on single processes. Using
ps
may leave a systemd
service in an
inconsistent state.
systemctl
also controls whether services start at
boot, see xref linkend="FOO".
3 Starting and stopping services with systemctl #
systemctl status SERVICE-NAME
Check if a service is running, stopped, enabled, or masked, and display the most recent log entries.
systemctl start SERVICE-NAME
Start a service.
systemctl stop SERVICE-NAME
Stop a service.
systemctl restart SERVICE-NAME
Stop the service and then start it. If a service is not running it will be started.
systemctl try-restart SERVICE-NAME
Restart a service if it is running. This has no effect on a service that is not running.
systemctl reload SERVICE-NAME
Reload the service's configuration file without interrupting operation.
systemctl reload-or-restart SERVICE-NAME
Reload the service if it supports reloading, otherwise it restarts the service. If the service is not running it will be started.