Control the systemd system and service manager

systemctl [options …] command [name …]

Inspect and control the state of the "systemd" system and service manager.

Systemd manages processes (daemons) starting, stopping, recovery and environment, like cron, syslog, …

As is the case with all the documentation found here, this is terisfied and man systemctl should be consulted for the real details.


-t t[,t …
--type=t[,t …
list of unit types such as service and socket.
Available unit types:
service, socket, busname, target, device, mount, automount, swap, timer, path, slice, scope

limit display to certain unit types.

help list allowed values and exit.

systemctl -t socket
UNIT                            LOAD   ACTIVE SUB       DESCRIPTION
avahi-daemon.socket             loaded active running   Avahi mDNS/DNS-SD Stack Activation Socket
dbus.socket                     loaded active running   D-Bus System Message Bus Socket
syslog.socket                   loaded active running   Syslog Socket
systemd-fsckd.socket            loaded active listening fsck to fsckd communication Socket
systemd-initctl.socket          loaded active listening /dev/initctl Compatibility Named Pipe
systemd-journald-dev-log.socket loaded active running   Journal Socket (/dev/log)
systemd-journald.socket         loaded active running   Journal Socket
systemd-rfkill.socket           loaded active listening Load/Save RF Kill Switch Status /dev/rfkill Watch
systemd-udevd-control.socket    loaded active running   udev Control Socket
systemd-udevd-kernel.socket     loaded active running   udev Kernel Socket
triggerhappy.socket             loaded active running   triggerhappy.socket

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.

11 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use systemctl list-unit-files.

--state= unit LOAD, SUB, or ACTIVE states. When listing units, show only those in the specified states. Use --state=failed to show only failed units.

unit load states:

stub, loaded, not-found, error, merged, masked

unit active states:

active, reloading, inactive, failed, activating, deactivating

unit substates

  • automount : dead, waiting, running, failed
  • busname : dead, making, registered, listening, running, sigterm, sigkill, failed
  • device : dead, tentative, plugged
  • mount : dead, mounting, mounting-done, mounted, remounting, unmounting, mounting-sigterm, mounting-sigkill,
    remounting-sigterm, remounting-sigkill, unmounting-sigterm, unmounting-sigkill, failed
  • path : dead, waiting, running, failed,
  • scope : dead, running, abandoned, stop-sigterm, stop-sigkill, failed
  • service : dead, start-pre, start, start-post, running, exited, reload, stop, stop-sigabrt, stop-sigterm, stop-sigkill, stop-post, final-sigterm, final-sigkill,
    failed, auto-restart
  • slice : dead, active
  • socket : dead, start-pre, start-chown, start-post, listening, running, stop-pre,
    stop-pre-sigterm, stop-pre-sigkill, stop-post, final-sigterm, final-sigkill, failed
  • swap : dead, activating, activating-done, active, deactivating, activating-sigterm, activating-sigkill,
    deactivating-sigterm, deactivating-sigkill, failed
  • target : dead, active
  • timer : dead, waiting, running, elapsed, failed

help list allowed values and exit. (shown above)

systemctl --state=masked
  UNIT                LOAD   ACTIVE   SUB  DESCRIPTION      
* grafana.service     masked inactive dead grafana.service  
* mountkernfs.service masked inactive dead mountkernfs.service

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.

2 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

-p p[,p …
--property= p[,p …
When showing unit/job/manager properties with show , limit display to properties specified . such as "MainPID". .
Shell completion is implemented for property names.
For the manager itself, systemctl show will show all available properties. See systemd-system.conf(5).

Properties for units vary by unit type, so showing any unit (even a non-existent one) is a way to list properties pertaining to this type.
showing any job will list properties pertaining to all jobs.
Properties are documented in systemd.unit(5), and individual unit types systemd.service(5), systemd.socket

With list-units, show inactive units and units which are following other units.
When showing unit/job/manager properties, show all properties

To list all units installed in the file system, use list-unit-files .

With list-dependencies, recursively show dependencies of all dependent units (by default only dependencies of target units are shown).

When listing units, show units of local containers. prefixed with containerName:.
--reverse Show reverse dependencies between units with list-dependencies,
i.e. follow dependencies of type WantedBy=, RequiredBy=, PartOf=, BoundBy=, instead of Wants= and similar.
Do not ellipsize unit names, process tree entries, journal output, or truncate unit descriptions in the output of status, list-units, list-jobs, and list-timers.
Also, show installation targets in the output of is-enabled.
--value with show, only print the value
--show-types When showing sockets
--job-mode= When queuing a new job, controls how to deal with already queued jobs.
fail, replace, replace-irreversibly,isolate, ignore-dependencies, ignore-requirements or flush.
Default: replace except when the isolate command is used which implies the "isolate" job mode.

fail if a requested operation conflicts with a pending job (more specifically: causes an already pending start job to be reversed into a stop job or vice versa), cause the operation to fail.
replace (default) any conflicting pending job will be replaced, as necessary.
replace-irreversibly like "replace", but also mark the new jobs as irreversible. This prevents future conflicting transactions from replacing these jobs (or even being enqueued while the irreversible jobs are still pending). Irreversible jobs can still be cancelled using the cancel command.
isolate is only valid for start and causes all other units to be stopped when the specified unit is started. This mode is always used when the isolate command is used.
flush queued jobs are canceled when the new job is enqueued.
ignore-dependencies all unit dependencies are ignored for this new job and the operation is executed immediately.
If passed, no required units of the unit passed will be pulled in, and no ordering dependencies will be honored. Debugging and rescue tool and should not be used by applications.
ignore-requirements is similar to ignore-dependencies, but only causes the requirement dependencies to be ignored, the ordering dependencies will still be honored.
-i --ignore-inhibitors When shutdown or a sleep state is requested, ignore inhibitor locks.
Applications can establish inhibitor locks to prevent critical operations (such as CD burning ) from being interrupted by shutdown or a sleep state.
Without --ignore-inhibitors if locks have been taken, shutdown and sleep will fail and a list of active locks is output.
Suppress output of the results of various commands and also the hints about truncated log lines.
Does not suppress output of commands for which the printed output is the only result (like show).
Errors are always printed.
--no-block Do not synchronously wait for the requested operation to finish.
If this is not specified, the job will be verified, enqueued and systemctl will wait until the unit's start-up is completed.
By passing this argument, it is only verified and enqueued.
May not be combined with --wait.
--wait Synchronously wait for started units to terminate again. may not be combined with --no-block.
this will wait indefinitly if any given unit never terminates (by itself or by getting stopped explicitly); particularly services which use .
--user Talk to the service manager of the calling user, rather than the service manager of the system.
--system Talk to the service manager of the system. This is the implied default.
--no-wall Do not send wall message before halt, power-off, reboot.
--global When used with enable and disable, operate on the global user configuration directory, thus enabling or disabling a unit file globally for all future logins of all users.
--no-ask-password When used with start and related commands, disables asking for passwords. Background services may require input of a password or passphrase string, for example to unlock system hard disks or cryptographic certificates. Unless this option is specified and the command is invoked from a terminal, systemctl will query the user on the terminal for the necessary secrets. Use this option to switch this behavior off. In this case, the password must be supplied by some other means (for example graphical password agents) or the service might fail. This also disables querying the user for authentication for privileged operations.
When used with enable, overwrite any existing conflicting symlinks. When used with edit, create all of the specified units which do not already exist. When used with halt, poweroff, reboot or kexec, execute the selected operation without shutting down all units. However, all processes will be killed forcibly and all file systems are unmounted or remounted read-only. This is hence a drastic but relatively safe option to request an immediate reboot. If --force is specified twice for these operations (with the exception of kexec), they will be executed immediately, without terminating any processes or unmounting any file systems. Warning: specifying --force twice with any of these operations might result in data loss. Note that when --force is specified twice the selected operation is executed by systemctl itself, and the system manager is not contacted. This means the command should succeed even when the system manager hangs or crashed.
--message= When used with halt, poweroff, reboot or kexec, set a short message explaining the reason for the operation. The message will be logged together with the default shutdown message.
--root= When used with enable/disable/is-enabled (and related commands), use the specified root path when looking for unit files. If this option is present, systemctl will operate on the file system directly, instead of communicating with the systemd daemon to carry out changes.
--runtime When used with enable, disable, edit, (and related commands), make changes only temporarily, so that they are lost on the next reboot. This will have the effect that changes are not made in subdirectories of /etc but in /run, with identical immediate effects, however, since the latter is lost on reboot, the changes are lost too. Similarly, when used with set-property, make changes only temporarily, so that they are lost on the next reboot.
--preset-mode= Takes one of "full" (the default), "enable-only", "disable-only". When used with the preset or preset-all commands, controls whether units shall be disabled and enabled according to the preset rules, or only enabled, or only disabled.
--firmware-setup When used with the reboot command, indicate to the system's firmware to boot into setup mode. Note that this is currently only supported on some EFI systems and only if the system was booted in EFI mode.
--plain When used with list-dependencies, list-units or list-machines, the output is printed as a list instead of a tree, and the bullet circles are omitted.
Execute the operation remotely. Specify a hostname, or a username and hostname separated by "@", to connect to. The hostname may optionally be suffixed by a container name, separated by ":", which connects directly to a specific container on the specified host. This will use SSH to talk to the remote machine manager instance. Container names may be enumerated with machinectl -H HOST.
Execute operation on a local container. Specify a container name to connect to.
--no-pager Do not pipe output into a pager.
--no-legend Do not print the legend, i.e. column headers and the footer with hints.
-h, --help


Unit Commands

list-units [jjj…] currently in memory. includng units that are either referenced directly or through a dependency, units that are pinned by applications programmatically, or units that were active in the past and have failed.
By default only units which are active, have pending jobs, or have failed are shown;
this can be changed with --all.
If one or more jjj are specified, only units matching one of them are shown, filtered by --type and --state

This is the default command. example

list-sockets [jjj…] currently in memory, ordered by listening address.
output similar to:

               LISTEN           UNIT                        ACTIVATES
               /dev/initctl     systemd-initctl.socket      systemd-initctl.service
               [::]:22          sshd.socket                 sshd.service
               kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service

               5 sockets listed.
addresses might contains spaces, this output is not suitable for programmatic consumption.
see --show-types, --all, and --state
list-timers [jjj…] currently in memory, ordered by the time they elapse next. see --show-types, --all, and --state
start jjj glob patterns operate on the set of primary names of units currently in memory.
Units not active and are not in a failed state usually are not in memory, and will not be matched by any pattern.
In case of instantiated units, systemd is often unaware of the instance name until the instance has been started.
using glob patterns with start has limited usefulness, secondary alias names of units are not considered.
stop jjj deactivate
reload jjj Asks units to reload their configuration.
Will reload the service-specific configuration, not the unit configuration file of systemd.
to reload the configuration file of a unit, use the daemon-reload command.
Example case of Apache, this will reload Apache's httpd.conf in the web server, not the apache.service systemd unit file.

not the daemon-reload

restart jjj If not running , they will be started.
try-restart jjj if the units are running. does nothing if not running.
reload-or-restart jjj if they support it. If not, restart them .
If the units are not running yet, they will be started.
try-reload-or-restart jjj Reload one or more units if they support it. If not, restart them . does nothing if the units are not running.
isolate NAME Start the unit specified on the command line and its dependencies and stop all others.
If no extension is given, .target is used is used
This is similar to changing the runlevel in a traditional init system. The isolate command will immediately stop processes that are not enabled in the new unit, possibly including the graphical environment or terminal you are currently using. Note that this is allowed only on units where AllowIsolate= is enabled. See systemd.unit(5) for details.
kill jjj Send a signal to one or more processes of the unit.
   -s SIGsss
   --signal= SIGsss
with kill, SIGTERM, SIGINT or SIGSTOP. default:TERM.
   --kill-who= with kill, which processes to send a signal to.
Must be one of main, control or all to select whether to kill only the main process, the control process or all processes of the unit.
The main process of the unit is the one that defines the life-time of it.
A control process of a unit is one that is invoked by the manager to induce state changes of it.
For example, all processes started due to the ExecStartPre=, ExecStop= or ExecReload= settings of service units are control processes.
there is only one control process per unit at a time, as only one state change is executed at a time.
For services of type Type=forking, the initial process started by the manager for ExecStart= is a control process, while the process ultimately forked off by that one is then considered the main process of the unit (if it can be determined). This is different for service units of other types, where the process forked off by the manager for ExecStart= is always the main process itself. A service unit consists of zero or one main process, zero or one control process plus any number of additional processes. Not all unit types manage processes of these types however. For example, for mount units, control processes are defined (which are the invocations of /bin/mount and /bin/umount), but no main process is defined. If omitted, defaults to all.
with the kill command, if no units were killed, results in an error.
is-active jjj
is-failed jjj
Returns 0 if at least one is active|failed, or non-zero otherwise.
Outputs the current unit state to standard output.Unless --quiet is specified,

From syslog:

daemon.warning systemd[1]: ruuvicollector.service: Failed with result 'exit-code'.

 systemctl is-active RuuviCo*    ; echo $?
 systemctl is-failed RuuviCo*    ; echo $?
 systemctl is-failed ruuvicollector.service ; echo $?
status [jjj|pid]] Show terse runtime status information, followed by most recent log data from the journal.
If no units are specified, show system status.
With --all, also show the status of all units (subject to limitations specified with -t).

By default, only shows 10 lines of output and ellipsizes lines to fit in the terminal window.
This can be changed with --lines and --full,
journalctl --unit=NAME or journalctl --user-unit=NAME use a similar filter for messages and might be more convenient.

 sudo systemctl status influxdb       
* influxdb.service - InfluxDB is an open-source, distributed, time series database
   Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2018-12-01 19:24:27 EST; 1h 22min ago
 Main PID: 14600 (influxd)
   CGroup: /system.slice/influxdb.service
           `-14600 /usr/bin/influxd -config /etc/influxdb/influxdb.conf

Dec 01 20:15:43 pi93graf influxd[14600]: [httpd] ::1 - - [01/Dec/2018:20:15:43 -0500] "POST /query?chunked=true&db=ruuvi&q=select+distinct%2
Dec 01 20:15:58 pi93graf influxd[14600]: [httpd] ::1 - - [01/Dec/2018:20:15:58 -0500] "POST /query?chunked=true&db=ruuvi&q=SELECT+DISTINCT%2
Dec 01 20:16:15 pi93graf influxd[14600]: [httpd] ::1 - - [01/Dec/2018:20:16:15 -0500] "POST /query?chunked=true&db=ruuvi&q=SELECT+DISTINCT%2
Dec 01 20:16:21 pi93graf influxd[14600]: [httpd] ::1 - - [01/Dec/2018:20:16:21 -0500] "POST /query?chunked=true&db=ruuvi&q=SELECT+DISTINCT%2
Dec 01 20:16:59 pi93graf influxd[14600]: [httpd] ::1 - - [01/Dec/2018:20:16:59 -0500] "POST /query?chunked=true&db=ruuvi&q=SELECT+minium%28b
Dec 01 20:17:31 pi93graf influxd[14600]: [httpd] ::1 - - [01/Dec/2018:20:17:31 -0500] "POST /query?chunked=true&db=ruuvi&q=SELECT+min%28batt
Dec 01 20:17:48 pi93graf influxd[14600]: [httpd] ::1 - - [01/Dec/2018:20:17:48 -0500] "POST /query?chunked=true&db=ruuvi&q=SELECT+min%28batt
Dec 01 20:18:04 pi93graf influxd[14600]: [httpd] ::1 - - [01/Dec/2018:20:17:55 -0500] "POST /query?chunked=true&db=ruuvi&q=SELECT+min%28batt
Dec 01 20:18:43 pi93graf influxd[14600]: [httpd] ::1 - - [01/Dec/2018:20:18:30 -0500] "POST /query?chunked=true&db=ruuvi&q=SELECT+mac%2C+min
Dec 01 20:22:28 pi93graf influxd[14600]: [httpd] ::1 - - [01/Dec/2018:20:22:10 -0500] "POST /query?chunked=true&db=ruuvi&q=SELECT+mac%2C+min

Warning: influxdb.service changed on disk. Run 'systemctl daemon-reload' to reload units.
with status, controls the number of journal lines to show, counting from the most recent ones. Default 10.
-o with status, controls the formatting of the journal entries. see journalctl. Default short
--output=short| short-full| short-iso| short-precise| short-monotonic| short-unix| verbose| export|
         json| json-pretty| json-sse|
show [jjj|job]] Show properties of one or more units, jobs, or the manager itself.
If no argument is specified, properties of the manager will be shown.
If a unit name is specified, properties of the unit are shown, and if a job ID is specified, properties of the job are shown.
By default, empty properties are suppressed. Use --all to show those too.
To select specific properties to show, use --property=.
used when parsable output is required. Use status for formatted human-readable output.
systemctl show           
  UNKN = Wed 1969-12-31 19:00:00 EST
FinishTimestamp=Mon 2018-11-05 12:23:01 EST

GeneratorsStartTimestamp=Thu 2016-11-03 13:16:42 EDT
GeneratorsFinishTimestamp=Thu 2016-11-03 13:16:42 EDT

UnitsLoadStartTimestamp=Thu 2016-11-03 13:16:42 EDT

UnitsLoadFinishTimestamp=Thu 2016-11-03 13:16:43 EDT
DefaultStandardOutput=journal DefaultStandardError=journal RuntimeWatchdogUSec=0 ShutdownWatchdogUSec=10min SystemState=running DefaultTimerAccuracyUSec=1min DefaultTimeoutStartUSec=1min 30s DefaultTimeoutStopUSec=1min 30s DefaultRestartUSec=100ms DefaultStartLimitIntervalSec=10000000 DefaultStartLimitBurst=5 DefaultCPUAccounting=no DefaultBlockIOAccounting=no DefaultMemoryAccounting=no DefaultTasksAccounting=yes
DefaultLimits ; 
++unlimited++ ==

cat jjj Show backing files of one or more units. Prints the "fragment" and "drop-ins" (source files) of units. Each file is preceded by a comment which includes the file name. Note that this shows the contents of the backing files on disk, which may not match the system manager's understanding of these units if any unit files were updated on disk and the daemon-reload command wasn't issued since.
set-property name assignment Set unit properties at runtime, changing configuration parameter properties such as resource control settings at runtime.
Not all properties may be changed at runtime, but many resource control settings (primarily those in systemd.resource-control(5)) may. The changes are applied instantly, and stored on disk for future boots, unless --runtime is passed, in which case the settings only apply until the next reboot. The syntax of the property assignment follows closely the syntax of assignments in unit files. Example: systemctl set-property foobar.service CPUShares=777 If the specified unit appears to be inactive, the changes will be only stored on disk as described previously hence they will be effective when the unit will be started. Note that this command allows changing multiple properties at the same time, which is preferable over setting them individually. Like unit file configuration settings, assigning the empty list to list parameters will reset the list.
help jjj|PID Show manual pages.
reset-failed [jjj] Default all units.
When a unit fails (example: exiting with non-zero error code, terminating abnormally or timing out), it enters the "failed" state and its exit code and status is recorded for introspection by the administrator until the service is restarted or reset with this command.
list-dependencies [jjj] Shows units required and wanted by the specified unit. This recursively lists units following the Requires=, Requisite=, ConsistsOf=, Wants=, BindsTo= dependencies.
If no unit is specified, is implied. By default, only target units are recursively expanded.
With --all is passed, all other units are recursively expanded as well. --reverse--after, --before may be used to change what types of dependencies are shown.
 systemctl list-dependencies
* `
*   |-auth-rpcgss-module.service
*   |-nfs-blkmap.service
*   `
recursively show dependencies of all dependent units (by default only dependencies of target units are shown).
--after With list-dependencies, show the units that are ordered before the specified unit. i.e. recursively list units following After= dependency.

Any After= dependency is mirrored to create a Before= dependency.
Temporal dependencies may be specified explicitly, but are created implicitly for units which are WantedBy= targets (see, and as a result of other directives (for example RequiresMountsFor=).
Both explicitly and implicitly introduced dependencies are shown with list-dependencies.

--before With list-dependencies, show the units that are ordered after the specified unit. i.e. recursively list units following Before= dependency.
Unit File Commands
list-unit-files [jjj] List unit files installed on the system, in combination with their enablement state (as reported by is-enabled).
UNIT FILE                              STATE
proc-sys-fs-binfmt_misc.automount      static
-.mount                                generated
boot.mount                             generated
dev-hugepages.mount                    static   
dev-mqueue.mount                       static   
proc-fs-nfsd.mount                     static   
proc-sys-fs-binfmt_misc.mount          static   
run-rpc_pipefs.mount                   static   
sys-fs-fuse-connections.mount          static   
sys-kernel-config.mount                static   
sys-kernel-debug.mount                 static   
varnew.mount                           generated
systemd-ask-password-console.path      static   
systemd-ask-password-plymouth.path     static   
systemd-ask-password-wall.path         static   
session-c1.scope                       transient
2ping.service                          disabled 
alsa-restore.service                   static   
alsa-state.service                     static   
alsa-utils.service                     masked   
anacron.service                        enabled  
bluemon.service                        generated
bluetooth.service                       enabled  
bootlogd.service                        masked   
bootlogs.service                        masked   
bootmisc.service                        masked   
bthelper@.service                      static   
checkfs.service                         masked   
checkroot-bootclean.service             masked   
grafana-server.service                 masked   
grafana.service                        masked   
halt.service                           masked   
hciuart.service                        enabled  
hostname.service                       masked   
hwclock.service                        masked   
ifup@.service                          static   
influx.service                         disabled 
influxd.service                        enabled  
influxdb.service                       enabled  

rc-local.service                       static   
rc.local.service                       static   
resize2fs_once.service                 generated 
rsyslog.service                        enabled  
ruuvicollector.service                 enabled  
wpa_supplicant.service                 disabled 
wpa_supplicant@.service                disabled 
…                       static   
…                          static   
anacron.timer                          enabled    
apt-daily-upgrade.timer                enabled    
apt-daily.timer                        enabled    
systemd-tmpfiles-clean.timer           static  

290 unit files listed.

enable name…, path… Enable units or unit instances. Creates a set of symlinks, as per the [Install] sections of the unit files.
System manager configuration is reloaded to ensure the changes effected immediately.
Does not start units being enabled (see --now or invoke start with appropriate arguments later.)
In case of unit instance enablement (i.e. enablement of units of the form foo@bar.service), symlinks named the same as instances are created in the unit configuration directory, which point to the single template unit file they are instantiated from.

expects unit names (in which case various unit file directories are automatically searched for unit files with appropriate names), or absolute paths to unit files (in which case these files are read directly).
If a specified unit file is located outside of the usual unit file directories, an additional symlink is created, linking it into the unit configuration path, thus ensuring it is found when requested by commands such as start.

Outputs file system operations executed. suppress with --quiet.

Creates only the symlinks suggested in the [Install] section of the unit files.

Changes can be made by placing or removing symlinks below this directory. useful to create configurations that deviate from the suggested default installation.
Use reload daemon to effect the changes

Depending on whether --system, --user, --runtime, or --global is specified, this enables the unit for the system, for the calling user only, for only this boot of the system, or for all future logins of all users, or only this boot. in the last case, no systemd daemon configuration is reloaded.

masked units cannot be enabled.

--now with enable, units will also be started if enabled.
--no-reload with enable and disable, do not implicitly reload daemon configuration
disable name Removes symlinks to the unit files backing the specified units from the unit configuration directory, and undoes any changes made by enable or link.
Removes all symlinks to matching unit files, including manually created ones
Also= units are disable as well.

Not symmetric with enable, as disable may remove more symlinks than a prior enable invocation of the same unit created.
Does not implicitly stop the units that are being disabled. If this is desired, either combine this command with --now , or invoke the stop later.

outputs information about the file system operations (symlink removals) executed. may be suppressed with --quiet. honors --system
--user, --runtime and --global in a similar way as enable.

Reloads system manager configuration after completing the operation.

--now with disable , the units disabled will also be stopped
reenable name Reenable one or more units, . This is a combination of disable and enable and is useful to reset the symlinks a unit file is enabled with to the defaults configured in its "[Install]" section. This command expects a unit name only, it does not accept paths to unit files.
mask name Mask one or more units, .
link these unit files to /dev/null, making it impossible to start them.
This is a stronger version of disable, since it prohibits all kinds of activation of the unit, including enablement and manual activation. Use this option with care. This honors the --runtime option to only mask temporarily until the next reboot of the system. The --now option may be used to ensure that the units are also stopped. This command expects valid unit names only, it does not accept unit file paths.
--now with mask, the units masked are stopped.
unmask name Unmask unit files. unit names only, not unit file paths.
preset name Reset the enable/disable status unit files, to the defaults configured in the preset policy files. Same as disable or enable depending how the unit is listed in the preset files.

Use --preset-mode= to control whether units shall be enabled and disabled, only enabled, or only disabled.

If the unit carries no install information, it will be silently ignored by this command. NAME must be the real unit name, any alias names are ignored .
see systemd.preset(5). For more information on the concept of presets, see Preset[1] .

preset-all Resets all installed unit files to the defaults configured in the preset policy file (see above).
Use --preset-mode= to control whether units shall be enabled and disabled, or only enabled, or only disabled.
is-enabled name If any of the unit files are enabled (as with enable), returns exit code of 0
Outputs the current enable status (see table).
To suppress output use --quiet.
To show installation targets, use --full.
exit code
Enabled via .wants/, .requires/ or alias symlinks
(permanently in /etc/systemd/system/, or transiently in /run/systemd/system/).
Made available through one or more symlinks to the unit file
(permanently in /etc/systemd/system/ or transiently in /run/systemd/system/), even though the unit file might reside outside of the unit file search path.
> 0
Completely disabled, so that any start operation on it fails
(permanently in /etc/systemd/system/ or transiently in /run/systemd/systemd/).
> 0
static The unit file is not enabled, and has no provisions for enabling in the [Install] unit file section. <0
indirect The unit file itself is not enabled, but it has a non-empty Also= setting in the [Install] unit file section, listing other unit files that might be enabled. 0
disabled The unit file is not enabled, but contains an [Install] section with installation instructions. > 0
generated The unit file was generated dynamically via a generator tool. See systemd.generator(7). Generated unit files may not be enabled, they are enabled implicitly by their generator. 0
transient The unit file has been created dynamically with the runtime API. Transient units may not be enabled. 0
bad The unit file is invalid or another error occurred. Note that is-enabled will not actually return this state, but print an error message instead. However the unit file listing printed by list-unit-files might show it. > 0
link PATH... Link a unit file that is not in the unit file search paths into the unit file search path. expects an absolute path to a unit file.
May be undone with disable. Makes a unit file available for commands such as start even though it is not installed directly in the unit search path.
revert name Revert unit files to their vendor versions. Removes drop-in configuration files that modify units, as well as any user-configured unit file that overrides a matching vendor supplied unit file.
For a unit foo.service the matching directories foo.service.d/ with all their contained files are removed, both below the persistent and runtime configuration directories (i.e. below /etc/systemd/system and /run/systemd/system); if the unit file has a vendor-supplied version (i.e. a unit file located below /usr) any matching persistent or runtime unit file that overrides it is removed.
If a unit file has no vendor-supplied version (i.e. is only defined below /etc/systemd/system or /run/systemd/system, but not in a unit file stored below /usr), it is not removed. Masked units are unmasked.

Used to undo all changes made with systemctl edit, systemctl set-property and systemctl mask and puts the original unit file with its settings back in effect.

add-wants target name
add-requires target name
Adds Wants= or "Requires= dependencies,
Honors --system, --user, --runtime and --global in a way similar to enable.
sudo systemctl  add-requires  ruuvicollector.service  influxdb.service
Created symlink /etc/systemd/system/ruuvicollector.service.requires/influxdb.service -> /lib/systemd/system/influxdb.service.
edit name … Edit a drop-in snippet or a whole replacement file if --full is specified, to extend or override the specified unit.
Depending on whether --system (the default), --user, or --global is specified, creates a drop-in file for each unit either for the system, for the calling user, or for all futures logins of all users. Then, the editor (see the "Environment" section below) is invoked on temporary files which will be written to the real location if the editor exits successfully.
If --full is specified, this will copy the original units instead of creating drop-in files.
If --force is specified and any units do not already exist, new unit files will be opened for editing.
If --runtime is specified, the changes will be made temporarily in /run and they will be lost on the next reboot.
If the temporary file is empty upon exit, the modification of the related unit is canceled.

After the units have been edited, systemd configuration is reloaded (in a way that is equivalent to daemon-reload). Cannot be used to remotely edit units and cannot temporarily edit units which are in /etc, since they take precedence over /run.

get-default Return the default target to boot into. target unit name is aliased (symlinked) to.
set-default name Set the default target to boot into. This sets (symlinks) the alias to the given target unit.

Machine Commands

sudo list-machines [jjj] List the host and all running local containers with their state.
  NAME            STATE    FAILED JOBS
* pi93graf (host) degraded      2    0

1 machines listed.

Job Commands

list-jobs [jjj]
cancel [jjj] numeric job IDs. If no job ID is specified, cancel all pending jobs.

Environment Commands

show-environment Dump the environment block passed to all processes spawned.
systemctl show-environment
set-environment variable=value …
unset-environment variable [value] If only variable is specified, it will be removed .
If a variable and a value are specified, the variable is only removed if is value.
import-environment [variable] Import environment variables set on the client into the systemd manager environment block.
With no arguments the entire environment is imported.

Manager Lifecycle Commands

daemon-reload Reload the systemd manager configuration.
Rerun all generators (see systemd.generator(7)), reload all unit files, and recreate the entire dependency tree.
While the daemon is being reloaded, all sockets systemd listens on behalf of user configuration stay accessible.
daemon-reexec Reexecute the systemd manager.
for debugging and package upgrades. might be helpful as a heavy-weight daemon-reload
Serialize the manager state, reexecute the process and deserialize the state again.

System Commands

is-system-running Returns 0 when the system is fully up and running, specifically not in startup, shutdown or maintenance mode, and with no failed services.
Use --quiet to suppress this output.
Exit Code
running system is fully operational. 0
degraded system is operational but one or more units failed. 1
initializing Early bootup, before is reached or maintenance state entered. > 0
starting Late bootup, before job queue becomes idle for the first time, or one of the rescue targets are reached. > 0
maintenance rescue or emergency target is active. > 0
stopping manager is shutting down. > 0
offline manager is not running. Specifically, this is the operational state if an incompatible program is running as system manager (PID 1). > 0
unknown operational state could not be determined, due to lack of resources or another error > 0
default Enter default mode. mostly equivalent to isolate
rescue Enter rescue mode. mostly equivalent to isolate, also outputs a wall message
emergency Enter emergency mode. mostly equivalent to isolate, also outputs a wall message
halt Shut down and halt the system. mostly equivalent to start --job-mode=replace-irreversibly, also outputs a wall message .
With --force shutdown of all running services is skipped, however all processes are killed and all file systems are unmounted or mounted read-only, immediately followed by the system halt.
With --force --force the operation is immediately executed without terminating any processes or unmounting any file systems. Executed by systemctl itself, the system manager is not contacted. should succeed even when the system manager hangs or crashed. This will result in data loss.
poweroff Shut down and power-off the system. mostly equivalent to start
Same as halt (including --force options) followed by powering off.
reboot [arg] Shut down and reboot the system. mostly equivalent to start --job-mode=replace-irreversibly, also outputs a wall message .
Same as halt (including --force options followed by a boot.
arg will be passed to the reboot(2) system call. The value is architecture and firmware specific. As an example, "recovery" might be used to trigger system recovery, and "fota" might be used to trigger a "firmware over the air" update.
kexec Shut down and boot the system via kexec. mostly equivalent to start --job-mode=replace-irreversibly, also output a wall message
--force as with halt, immediately followed by the boot.
suspend triggers target.
hibernate triggers target.
hybrid-sleep triggers target.
exit [exit_code] Quit systemd manager with exit_code, only for user service managers (i.e. in conjunction with --user option) or in containers and is equivalent to poweroff otherwise.
switch-root root [init] Switches to a different root directory and executes a new system manager process below it. Intended for usage in initial RAM disks ("initrd"), and will transition from the initrd's system manager process (a.k.a. "init" process) to the main system manager process which is loaded from the actual host volume.
This call takes two arguments: the directory that is to become the new root directory, and the path to the new system manager binary below it to execute as PID 1. Default init, a systemd binary will automatically be searched for and used as init.
By default the state of the initrd's system manager process is passed to the main system manager, which allows later introspection of the state of the services involved in the initrd boot phase.

Parameter Syntax

Unit commands take either a single unit name or multiple unit specifications (designated as jjj …).
If the suffix is not specified (unit name is "abbreviated"), .service is by default, or
a type-specific suffix in case of commands which operate only on specific unit types.
For example:
           # systemctl start sshd 
           # systemctl start sshd.service
are equivalent, as are

           # systemctl isolate default 
           # systemctl isolate
(absolute) paths to device nodes are automatically converted to device unit names, and other (absolute) paths to mount unit names.
           # systemctl status /dev/sda
           # systemctl status /home

       are equivalent to:

           # systemctl status dev-sda.device
           # systemctl status home.mount
In the second case, shell-style globs will be matched against the primary names of all units currently in memory; literal unit names, with or without a suffix, will be treated as in the first case. This means that literal unit names always refer to exactly one unit, but globs may match zero units and this is not considered an error.

Glob patterns use fnmatch(3), so normal shell-style globbing rules are used, and "*", "?", "[]" may be used. See glob(7) for more details. The patterns are matched against the primary names of units currently in memory, and patterns which do not match anything are silently skipped. For example:

 # systemctl stop sshd@*.service 
will stop all sshd@.service instances. Note that alias names of units, and units that aren't in memory are not considered for glob expansion.
For unit file commands, the specified NAME should be the name of the unit file (possibly abbreviated, see above), or the absolute path to the unit file:
           # systemctl enable foo.service 
           # systemctl link /path/to/foo.service


$SYSTEMD_EDITOR Editor to use when editing units; overrides $EDITOR and $VISUAL.
If neither $SYSTEMD_EDITOR nor $EDITOR nor $VISUAL are present or if it is set to an empty string or if their execution failed, systemctl will try to execute well known editors in this order: editor(1), nano(1), vim(1), vi(1).

$SYSTEMD_PAGER Pager to use when --no-pager is not given; overrides $PAGER. If neither $SYSTEMD_PAGER nor $PAGER are set, a set of well-known pager implementations are tried in turn, including less(1) and more(1), until one is found. If no pager implementation is discovered no pager is invoked. Setting this environment variable to an empty string or the value "cat" is equivalent to passing --no-pager.

$SYSTEMD_LESS Override the options passed to less (by default "FRSXMK").

$SYSTEMD_LESSCHARSET Override charset passed to less (default "utf-8", if the invoking terminal is determined to be UTF-8 compatible).


systemd(1), journalctl(1), loginctl(1), machinectl(1), systemd.unit, systemd.resource-control(5), systemd.special(7), wall(1), systemd.preset(5), systemd.generator(7), glob(7) NOTES 1. Preset