systemctl

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.

commands

-t t[,t …
--type=t[,t …
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 --type=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.


systemctl --type=target UNIT LOAD ACTIVE SUB DESCRIPTION basic.target loaded active active Basic System bluetooth.target loaded active active Bluetooth cryptsetup.target loaded active active Encrypted Volumes getty.target loaded active active Login Prompts local-fs-pre.target loaded active active Local File Systems (Pre) local-fs.target loaded active active Local File Systems multi-user.target loaded active active Multi-User System network-online.target loaded active active Network is Online network.target loaded active active Network nfs-client.target loaded active active NFS client services paths.target loaded active active Paths remote-fs-pre.target loaded active active Remote File Systems (Pre) remote-fs.target loaded active active Remote File Systems slices.target loaded active active Slices sockets.target loaded active active Sockets sound.target loaded active active Sound Card swap.target loaded active active Swap sysinit.target loaded active active System Initialization time-sync.target loaded active active System Time Synchronized timers.target loaded active active Timers
target encodes information about a target unit for grouping units and as well-known synchronization points during start-up.
Have no specific options.

Group units via dependencies (useful as boot targets), and to establish standardized names for synchronization points used in dependencies between units.

Automatic dependencies: Unless DefaultDependencies=no in either of related units or an explicit ordering dependency is already defined, target units implicitly complement all configured dependencies of type Wants or Requires with dependencies of type After=. that Wants= or Requires= must be defined in the target unit itself
for example define Wants=some.target in some.service, implicit ordering will not be added.

All targets gain Conflicts dependency against shutdown.target unless DefaultDependencies=no.

--no-pager Do not pipe output into a pager.
-l
--full
in the output of status, list-units, list-jobs, and list-timers do not ellipsize unit names, process tree entries, journal output, or truncate unit descriptions
--state=state Show only units in states :
  • LOAD : stub, loaded, not-found, error, merged, masked
  • ACTIVE : active, reloading, inactive, failed, activating, deactivating
  • SUB:
    • 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)

Example:

systemctl --state=failed # show only failed units.

pi94graf 6/14/22
Example:

> systemctl --state=not-found
  UNIT                           LOAD      ACTIVE   SUB  DESCRIPTION
* tmp.mount                      not-found inactive dead tmp.mount
* apparmor.service               not-found inactive dead apparmor.service
* auditd.service                 not-found inactive dead auditd.service
* bthelper.service               not-found inactive dead bthelper.service
* console-screen.service         not-found inactive dead console-screen.service

> systemctl --state=masked
  UNIT                LOAD   ACTIVE   SUB  DESCRIPTION
* mountkernfs.service masked inactive dead mountkernfs.service    
--job-mode= When queuing a new job, how to deal with already queued jobs.
Default: replace except with isolate .

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", 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 canceled
isolate only valid for start and causes all other units to be stopped when the specified unit is started. 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.
--no-block Do not wait for the operation to finish.
If not specified, the job will be verified, enqueued and systemctl will wait until the unit's start-up is completed.
--wait wait indefinitly for started units to terminate again. (Sounds bad) Beware of services which use RemainAfterExit=yes.
--user Use service manager of the calling user.
--system Use service manager of the system. Default
--no-ask-password With start and related commands, disables asking for passwords, which must be supplied by some other means (for example graphical password agents) or the service will fail.
-f
--force
With halt, poweroff, reboot or kexec, execute without shutting down all units.
All processes will be killed forcibly and all file systems are unmounted or remounted read-only.
Specified twice (except with kexec), the operation is executed immediately, without terminating any processes or unmounting any file systems, executed by systemctl. The system manager is not contacted.
The command should succeed even when the system manager hangs or crashed.
--root=/path with enable/disable/is-enabled (and related commands), root path when looking for unit files.
Operates on the file system directly, not via systemd.
--runtime with enable/ disable/ edit, (and related commands), changes are not preserved for next boot.
Changes are not made in subdirectories of /etc but in /run, with identical immediate effects, With set-property, make changes only temporarily, they are lost on the next boot.
-H [uname@]host[:container]
--host= …
Execute the operation remotely.
container on the specified host. Uses issh to communicate to the remote machine manager instance. Container names may be enumerated with machinectl -H HOST.
-M
--machine=host
Execute operation on a local container. Specify a container name to connect to.
-q
--quiet
Suppress some of the output the hints about truncated log lines.
Does not suppress output of commands for which the output is the only result (like show).
Errors are always output.
--no-legend Do not output the legend, i.e. column headers and the footer with hints.
-h, --help
--version

COMMANDS

Unit Commands

Glob patterns operate on the set of primary names of units currently in memory.

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.
Default only units which are active, have pending jobs, or have failed are shown.
Filtered by --type and --state

This is the default command. example

   -a
  --all
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).

   -r
  --recursive
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.
  --plain output as a list instead of a tree.
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.
  --show-types When showing sockets
list-timers [jjj] currently in memory, ordered by the time they elapse next. see --show-types, --all, and --state
year, seconds and time zone removed in this document
 > systemctl list-timers
NEXT              LEFT          LAST       PASSED       UNIT                         ACTIVATES
Thu -01-17 21:01 35min    Thu -01-17 20:03 21min ago    anacron.timer                anacron.service
Fri -01-18 01:16 4h 50min Thu -01-17 08:23 12h ago      apt-daily.timer              apt-daily.service
Fri -01-18 06:36 10h      Thu -01-17 06:58 13h ago      apt-daily-upgrade.timer      apt-daily-upgrade.service
Fri -01-18 16:58 20h      Thu -01-17 16:58 3h 27min ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.ser

4 timers listed.
Pass --all to see loaded but inactive timers, too
* *-*-* *:*:* dow yyyy-mm-dd HH:MM:SS iweb
list-dependencies [jjj] Shows units required and wanted by the specified unit. recursively lists units following the Requires=, Requisite=, ConsistsOf=, Wants=, BindsTo= dependencies.
If no unit is specified, default.target is implied.
By default, only target units are recursively expanded.
With --all is passed, all other units are recursively expanded as well.
  --plain output as a list instead of a tree --reverse--after, --before may be used to change what types of dependencies are shown.
 systemctl list-dependencies remote-fs.target
remote-fs.target
* `-nfs-client.target
*   |-auth-rpcgss-module.service
*   |-nfs-blkmap.service
*   `-remote-fs-pre.target
   -a
  --all
recursively show dependencies of all dependent units (by default only dependencies of target units are shown).
   --after 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 systemd.target(5)), and as a result of other directives (for example RequiresMountsFor=).
Both explicitly and implicitly introduced dependencies are shown with list-dependencies.

   --before show the units that are ordered after the specified unit. i.e. recursively list units following Before= dependency.
Unit File Commands
is-active jjj
is-failed jjj
Outputs the current unit state unless --quiet ,
Returns 0 if at least one is active | failed, or non-zero otherwise.

From syslog:

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

 systemctl is-active RuuviCo*    ; echo $?
3
 systemctl is-failed RuuviCo*    ; echo $?
1
 systemctl is-failed ruuvicollector.service ; echo $?
activating
1
is-enabled name If any of the unit files are enabled returns exit code of 0
--full shows installation targets
Outputs the current enable status unless --quiet
systemctl is-enabled  grafana-server
disabled
jebh:/ > echo $?
1
exit code
enabled
enabled-runtime
Enabled via .wants/, .requires/ or alias symlinks
permanently in /etc/systemd/system/ or
transiently in   /run/systemd/system/.
0
disabled not enabled, but contains an [Install] section . > 0
masked
masked-runtime
Completely disabled, so that any start operation on it fails
Permanently in /etc…or
transiently in    /run…), even though the unit file might reside outside of the unit file search path.
> 0
static unit file is not enabled and has no provisions for enabling in the [Install] section. <0
indirect unit itself is not enabled, has Also=jj setting in the [Install] section, listing other unit files that might be enabled. 0
generated unit file was generated dynamically via a generator tool. See systemd.generator(7).
Generated unit files are ONLY enabled implicitly by their generator.
0
transient unit file has been created dynamically with the runtime API.
Transient units may not be enabled.
0
bad unit file is invalid or an error occurred.
is-enabled does not display this state, rather it outputs an error message.
list-unit-files might show it.
> 0
status [jjj|pid]]
-n
--lines=n
number of journal lines to show, counting from the most recent ones. Default 10.
-o
--output=short| short-full| short-iso| short-precise| short-monotonic| short-unix| verbose| export|
json| json-pretty| json-sse| cat
formatting journal entries. see journalctl. Default short
Show runtime status and most recent log data from the (N.B. cut to terminal width!!)
If no units are specified, shows system status.
 systemctl status
* pi93graf
    State: running
     Jobs: 0 queued
   Failed: 0 units
    Since: Wed 1969-12-31 19:00:01 EST; 53 years 6 months ago
   CGroup: /
           |-user.slice
           | `-user-501.slice
           |   |-user@501.service
           |   | `-init.scope
           |   |   |-1560 /lib/systemd/systemd --user
           |   |   `-1563 (sd-pam)
           |   |-session-c1.scope
           |   | |-1554 sshd: dgerman [priv]
           |   | |-1572 sshd: dgerman@pts/0
           |   | |-1575 -bash
           |   | |-4461 -bash
           |   | `-4463 /bin/systemctl --no-pager status
           |   `-session-c2.scope
           |     |-2004 sshd: dgerman [priv]
           |     |-2015 sshd: dgerman@pts/1
           |     `-2018 -bash
           |-init.scope
           | `-1 /sbin/init
           `-system.slice
             |-influxdb.service
             | `-1108 /usr/bin/influxd -config /etc/influxdb/influxdb.conf
             |-ruuvicollector.service
             | |- 376 /bin/bash /home/pi/RuuviCollector/RuuviCollector
             | |-1307 java -jar target/ruuvi-collector-0.2.5.jar
             | |-1316 hcitool lescan --duplicates --passive
             | `-1318 hcidump --raw
             |-systemd-timesyncd.service
             | `-217 /lib/systemd/systemd-timesyncd
             |-dbus.service
             | `-255 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
             |-chronograf.service
             | `-361 /usr/bin/chronograf
             |-hciuart.service
             | `-406 /usr/bin/hciattach /dev/serial1 bcm43xx 3000000 flow - b8:27:eb:e3:a4:6c
             |-ssh.service
             | `-447 /usr/sbin/sshd -D
             |-avahi-daemon.service
             | |-282 avahi-daemon: running [pi93graf.local]
             | `-288 avahi-daemon: chroot helper
             |-system-getty.slice
             | `-getty@tty1.service
             |   `-918 /sbin/agetty --noclear tty1 linux
             |-wpa_supplicant.service
             | `-295 /sbin/wpa_supplicant -u -s -d -O /run/wpa_supplicant >/boot/log/wpa.log
             |-triggerhappy.service
             | `-297 /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --socket /run/thd.socket --user nobody --deviceglob /dev/inpu...
             |-systemd-logind.service
             | `-284 /lib/systemd/systemd-logind
             |-system-postfix.slice
             | `-postfix@-.service
             |   |- 804 /usr/lib/postfix/sbin/master -w
             |   |- 806 qmgr -l -t unix -u
             |   `-4088 pickup -l -t unix -u -c
             |-grafana.service
             | `-374 /usr/sbin/grafana --config=/etc/grafana/grafana.ini cfg:default.paths.logs=/var/log cfg:default.paths.data=/var/lib/...
             |-cron.service
             | `-292 /usr/sbin/cron -f
             |-systemd-udevd.service
             | `-113 /lib/systemd/systemd-udevd
             |-rsyslog.service
             | `-243 /usr/sbin/rsyslogd -n
             |-bluetooth.service
             | `-432 /usr/libexec/bluetooth/bluetoothd
             |-systemd-journald.service
             | `-78 /lib/systemd/systemd-journald
             |-dhcpcd.service
             | |-260 /sbin/dhcpcd -q -b
             | `-556 wpa_supplicant -B -c/etc/wpa_supplicant/wpa_supplicant.conf -iwlan0 -Dnl80211,wext
             `-kapacitor.service
               `-1631 /usr/bin/kapacitord -config /etc/kapacitor/kapacitor.conf
With --all, shows the status of all units (subject to limitations specified with --type).

By default, only shows 10 lines of output and ellipsizes lines to fit in the terminal window.
see --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
     Docs: https://docs.influxdata.com/influxdb/
 Main PID: 14600 (influxd)
   CGroup: /system.slice/influxdb.service
           `-14600 /usr/bin/influxd -config /etc/influxdb/influxdb.conf

widen terminal window to see all of the log message 

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.
show [jjj|job]]
  --value

output only the value
Show properties of units, jobs, or the manager itself.
If no argument is specified, properties of the manager will be shown.
With unit name/job ID , properties of the unit/job are shown

Empty properties are suppressed. Use --all to show those .
To select specific properties to show, use --property=.
used when parsable output is required.
Use status for formatted human-readable output.

Many default properties supresses in this document.

systemctl show influxdb.service| grep -v 18446744073709551615 |grep -v 65536|grep -v =0|grep -v '=no$'

ExecStart={
     path=/usr/lib/influxdb/scripts/influxd-systemd-start.sh ;
   argv[]=/usr/lib/influxdb/scripts/influxd-systemd-start.sh ;
      ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }
Type=forking
TimeoutStartUsec=1min 30s
TimeoutStopUsec=1min 30s
RuntimeMaxUsec=infinity
Slice=system.slice

StandardInput=null
StandardOutput=journal
StandardError=inherit

SyslogPriority=30
SyslogLevelPrefix=yes
SyslogLevel=6
SyslogFacility=3

Description=InfluxDB
Documentation=https://docs.influxdata.com/influxdb/
Id=influxdb.service
Names=influxdb.service

Restart=on-failure
PIDFile=/var/lib/influxdb/influxd.pid
RestartUsec=10min
EnvironmentFile=/etc/default/influxdb (ignore_errors=yes)
User=influxdb
Group=influxdb

Requires=
  system.slice
  sysinit.target
After=
  system.slice
  systemd-journald.socket
  sysinit.target
  basic.target
  network-online.target

LoadState=loaded
ActiveState=inactive
SubState=dead
FragmentPath=/lib/systemd/system/influxdb.service
UnitFileState=disabled
UnitFilePreset=enabled
Result=success

UID=4294967295
GID=4294967295

IgnoreSIGPIPE=yes
RestrictNamespace=2114060288
KillMode=control-group
KillSignal=15
SendSIGKILL=yes
Conflicts=shutdown.target
Before=shutdown.target

CanStart=yes
CanStop=yes
DefaultDependencies=yes
OnFailureJobMode=replace
JobTimeoutUsec=infinity
StartLimitIntervalSec=10000000
StartLimitBurst=5


systemctl show  
Version=232
Features=+PAM +AUDIT +SELINUX +IMA +APPARMOR
 +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT
 +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +
Architecture=arm
FirmwareTimestampMonotonic=0
LoaderTimestampMonotonic=0
  UNKN = Wed 1969-12-31 19:00:00 EST
KernelTimestamp=UNKN
KernelTimestampMonotonic=0
InitRDTimestampMonotonic=0
UserspaceTimestamp=UNKN
UserspaceTimestampMonotonic=1717322
FinishTimestamp=Mon 2018-11-05 12:23:01 EST
FinishTimestampMonotonic=20937116

SecurityStartTimestamp=UNKN
SecurityStartTimestampMonotonic=1754193
SecurityFinishTimestamp=UNKN
SecurityFinishTimestampMonotonic=1758961

GeneratorsStartTimestamp=Thu 2016-11-03 13:16:42
GeneratorsStartTimestampMonotonic=2020354
GeneratorsFinishTimestamp=Thu 2016-11-03 13:16:42
GeneratorsFinishTimestampMonotonic=2611909

UnitsLoadStartTimestamp=Thu 2016-11-03 13:16:42
UnitsLoadStartTimestampMonotonic=2624651

UnitsLoadFinishTimestamp=Thu 2016-11-03 13:16:43
UnitsLoadFinishTimestampMonotonic=3010388
LogLevel=info
LogTarget=journal-or-kmsg
NNames=232
NFailedUnits=0
NJobs=0
NInstalledJobs=192
NFailedJobs=0
Progress=1
Environment=LANG=C.UTF-8
    PATH=/usr/local/sbin:
        /usr/local/bin:
        /usr/sbin:
        /usr/bin:
        /sbin:/bin
ConfirmSpawn=no
ShowStatus=no
UnitPath=
    /run/systemd/transient
    /etc/systemd/system
    /run/systemd/system
    /run/systemd/generator
    /lib/systemd/system
    /usr/lib/systemd/system
    /
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 ;
∞ ==
18446744073709551615
i.e. FFFFFFFF FFFFFFFF
 CPU=
 CPUSoft=
 FSIZE=
 FSIZESoft=
 DATA=
 DATASoft=
 STACK=
 STACKSoft=8388608
 CORE=
 CORESoft=0
 RSS=
 RSSSoft=
 NOFILE=4096
 NOFILESoft=1024
 AS=
 ASSoft=
 NPROC=3400
 NPROCSoft=3400
 MEMLOCK=65536
 MEMLOCKSoft=65536
 LOCKS=
 LOCKSSoft=
 SIGPENDING=3400
 SIGPENDINGSoft=3400
 MSGQUEUE=819200
 MSGQUEUESoft=819200
 NICE=0
 NICESoft=0
 RTPRIO=0
 RTPRIOSoft=0
 RTTIME=
 RTTIMESoft=

DefaultTasksMax=4915
-p p[,p …
--property= p[,p …
With show unit/job/manager properties with, 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 lists 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

cat jjj Show backing files of units.
Prints the "fragment" and "drop-ins" (source files) of units.
Each file is preceded by a comment which includes the file name.
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

 [--runtime]
Set unit properties at runtime, changing configuration parameter properties such as resource control settings at runtime.
Not all properties may be changed at runtime, settings in systemd.resource-control(5)) may.
The changes are applied immediately and stored on disk .
With --runtime the settings only apply until the next boot.
The syntax of the property assignment follows the syntax of assignments in unit files.

Example: systemctl set-property foobar.service CPUShares=777

If the unit appears to be inactive, the changes will be stored on disk and will be effective when the unit will be started.

Allows changing multiple properties at the same time, which is preferable over setting them individually.
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 until the service is restarted or reset with this command.
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 
…
bluetooth.target                       static
…
umount.target                          static   
anacron.timer                          enabled  
apt-daily-upgrade.timer                enabled  
apt-daily.timer                        enabled  
systemd-tmpfiles-clean.timer           static

290 unit files listed.

       
enable unit…, path…
 [--force]
 [--now]
 [--runtime]
 [--no-reload]
Creates a set of symlinks, as per the [Install] sections of the unit files.
--force overwrites existing conflicting symlinks.

With --now starts units, otherwise does not start them.

System manager configuration is reloaded to ensure the changes effected immediately unless --no-reload.

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 (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 unit file is located outside of the usual unit file directories, an additional symlink is created, linking it into the unit configuration path, ensuring it is found when requested by commands such as start.

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

Creates symlinks as per 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.

> systemctl enable influxdb.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files ===
Authentication is required to manage system service or unit files.
Created symlink /etc/systemd/system/influxd.service -> 
                                        /lib/systemd/system/influxdb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/influxdb.service -> 
                                        /lib/systemd/system/influxdb.service.
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ===
Authentication is required to reload the systemd state.

> systemctl status influxdb.service
* influxdb.service - InfluxDB
   Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: https://docs.influxdata.com/influxdb/

systemctl start influxdb.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===

pi93graf: > systemctl status influxdb.service
* influxdb.service - InfluxDB
   Loaded: loaded (/lib/systemd/system/influxdb.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2022-11-07 19:10:50 EST; 2s ago
     Docs: https://docs.influxdata.com/influxdb/
  Process: 1066 ExecStart=/usr/lib/influxdb/scripts/influxd-systemd-start.sh 
                        (code=exited, status=0/SUCCESS)
 Main PID: 30167 (influxd)
   CGroup: /system.slice/influxdb.service
           `-30167 /usr/bin/influxd -config /etc/influxdb/influxdb.conf

Nov 07 9:10:50 pi93graf influxd-systemd-start.sh[1066]: 
                        ts=2022-11-08T00:10:50.10319Z lvl=info msg="Starting precreation serv 
Nov 07 9:10:50 pi93graf influxd-systemd-start.sh[1066]:                   line truncated at window size  ^
                        ts=2022-11-08T00:10:50.114868Z lvl=info msg="Starting snapshot service
Nov 07 9:10:50 pi93graf influxd-systemd-start.sh[1066]: 
                        ts=2022-11-08T00:10:50.115072Z lvl=info msg="Starting HTTP service" lo
Nov 07 9:10:50 pi93graf influxd-systemd-start.sh[1066]: 
                        ts=2022-11-08T00:10:50.115183Z lvl=info msg="opened HTTP access log" l
Nov 07 9:10:50 pi93graf influxd-systemd-start.sh[1066]: 
                        ts=2022-11-08T00:10:50.116027Z lvl=info msg="Listening on HTTP" log_id
Nov 07 9:10:50 pi93graf influxd-systemd-start.sh[1066]: 
                        ts=2022-11-08T00:10:50.116335Z lvl=info msg="Starting retention policy
Nov 07 9:10:50 pi93graf influxd-systemd-start.sh[1066]: 
                        ts=2022-11-08T00:10:50.120244Z lvl=info msg="Listening for signals" lo
Nov 07 9:10:50 pi93graf influxd-systemd-start.sh[1066]: 
                        [httpd] ::1 - - [07/Nov/2022:9:10:50 -0500] "GET /health HTTP/1.1" 20
Nov 07 9:10:50 pi93graf influxd-systemd-start.sh[1066]: InfluxDB started
Nov 07 9:10:50 pi93graf systemd[1]: Started InfluxDB.
reenable unir Combination of disable and enable. Useful to reset symlinks a unit file is enabled with to the defaults configured in its [Install].
name must be a unit name.
disable name
 [--no-reload]
 [--runtime]
 [--now]

  also=unit

Removes symlinks to the unit files backing the units from the unit configuration directory, and unit files, including manually created ones and undoes changes made by enable or link.
also=unit 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.
Include --now to stop units otherwise does not stop them.

Outputs information about the file system operations (symlink removals) executed. which 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 unless --no-reload.

--now the units will be stopped

--global With enable and disable, operate on the global user directory, i.e. for all future logins of all users.
mask name
 [--now]
Link these unit files to /dev/null, making it impossible to start them.
Stronger than disable, since it prohibits all kinds of activation of the unit, including enablement and manual activation. Use this option with care.
With --now the units masked are stopped.
With --runtime to only mask temporarily until the next boot.
Expects valid unit names , not unit file paths.
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.

If the unit ihas no install information, it will be silently ignored .
name must be the real unit name, alias names are ignored .
See systemd.preset(5).

   --preset-mode= with the preset or preset-all commands,   full (the default), enable-only, disable-only.
controls whether units shall be disabled and enabled according to the preset rules, or only enabled, or only disabled.
preset-all Resets all installed unit files to the defaults configured in the preset policy file (see above).
linked
linked-runtime
Made available through one or more symlinks to the unit file
(permanently in /etc…or transiently in /run…), even though the unit file might reside outside of the unit file search path.
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
 [--runtime]
 [--full]
 [--force]
 |--user|--system|--global]
Adds dependencies,
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 …
 [--runtime]
 [--full]
 [--force]
 |--user|--system|--global]
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.
With --full copy the original units instead of creating drop-in files.
With --force unit files will be created for editing if they don't exist.
With --runtime changes will be made temporarily and they will be lost on the next boot.

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 (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 default.target is aliased (symlinked) to.
set-default name Set the default target to boot into. This sets (symlinks) the default.target alias to the given target unit.
isolate name Allowed only on units where AllowIsolate= is enabled.
   grep AllowIsolate /etc/systemd/system

Start name and its dependencies and stop all others.
If no extension is given, .target is used is used

Similar to changing the runlevel in a traditional init system.

Immediately stops processes not enabled in the new unit, possibly including the graphical environment or terminal you are currently using.!,

start jjj 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 (issues SIGTERM)
try-restart jjj if the units are running.
try-reload-or-restart jjj Reload units if they support reload. If not, restart them ( most do not include reload).
restart jjj If not running , they will be started.
reload jjj Asks units to reload their configuration. ( most do not include reload)
Reloads the service-specific configuration, not the unit configuration file of systemd.
To reload the configuration file of a unit, use the daemon-reload
Example:
Apache: Apache's httpd.conf the web server, not the apache.service systemd unit file.
sudo systemctl reload influxdb
Failed to reload influxdb.service:
    Job type reload is not applicable for unit influxdb.service.
See system logs and 'systemctl status influxdb.service' for details.
reload-or-restart jjj reload if they support it. If not, restart them, If the units are not running they will be started.
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.
   --fail
   --job-mode=fail
with the kill command, if no units were killed, results in an error.

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.
  --plain output as a list instead of a tree

Job Commands

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

Environment Commands

show-environment passed to processes spawned.
systemctl show-environment
LANG=C.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
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 units failed. 1
initializing Early bootup, before basic.target 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. 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 default.target.
rescue Enter rescue mode. mostly equivalent to:
isolate rescue.target, outputs wall message
emergency Enter emergency mode. mostly equivalent to:
isolate emergency.target, outputs wall message
halt Shutdown and halt the system. mostly equivalent to:
start halt.target --job-mode=replace-irreversibly,
Outputs wall message .
Without --force shutdown of running services is skipped. All processes are killed and file systems are unmounted or mounted read-only, immediately followed by the system halt.
With --force immediately executed without terminating processes or unmounting file systems.
Executed by systemctl itself, the system manager is not contacted. should succeed even when the system manager hangs or crashed.

Results in data loss.

-i --ignore-inhibitors With shutdown or a sleep ignore inhibitor locks.
Applications establish inhibitor locks to prevent critical operations (such as CD burning ) from being interrupted .
Without --ignore-inhibitors if locks have been taken, shutdown and sleep will fail and list active locks.
poweroff Shut down and power-off the system. mostly equivalent to :
start poweroff.target
Same as halt (including --force ) followed by powering off.
reboot [arg] Shut down and reboot the system. mostly equivalent to start reboot.target --job-mode=replace-irreversibly, outputs 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.
Example:
"recovery" might be used to trigger system recovery,
"fota" might be used to trigger a "firmware over the air" update.
--firmware-setup with reboot , indicate to the system's firmware to boot into setup mode. Only supported on some EFI systems and only if the system was booted in EFI mode.
kexec Shut down and boot the system via kexec. mostly equivalent to:
start kexec.target --job-mode=replace-irreversibly, output a wall message
--force as with halt, immediately followed by the boot.
   --message=mmm With halt, poweroff, reboot or kexec, reason logged with the default shutdown message.
   --no-wall Do not send wall message before halt, power-off, reboot.
suspend triggers suspend.target target.
hibernate triggers hibernate.target target.
hybrid-sleep triggers hybrid-sleep.target 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 rootdir [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.
rootdir directory that is to become the new root directory,
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, allowing later inspection 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
       and
           # systemctl start sshd.service
are equivalent, as are
           # systemctl isolate default
       and
           # systemctl isolate default.target
(absolute) paths to device nodes are converted to device unit names, and other (absolute) paths to mount unit names.
           /dev/sda  =>  dev-sda.device
           /home     =>  home.mount 

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. Alias names of units, and units that aren't in memory are not considered for glob expansion. 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 shell-style globbing rules and "*", "?", "[]" may be used.
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.

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
       or
           # systemctl link /path/to/foo.service

ENVIRONMENT

$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).

Warnings and Errors

Journal has been rotated since unit was started. Log output is incomplete or unavailable.
journalctl

SEE ALSO

ArchLinux
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) systemd.conf
directives
system.com

ArchLinux
freeDeskTop.org/wiki/Software/systemd/Preset