Config...ketUnit(3pm)
so the header on this one reads Config...ketUnit(3pm) over on the left, User Contributed Perl Documentation on the right, and then Config...ketUnit(3pm) again, because Perl docs love a lil encore π
β¨ NAME β¨
Config::Model::models::Systemd::Section::SocketUnit β it's the Configuration class for Systemd::Section::SocketUnit. no cap, that's the whole name, it's giving very-many-colons but we move π
πΈ DESCRIPTION πΈ
These are Configuration classes used by Config::Model. that's it. that's the vibe. β¨
π Elements π
π Description
A brief, meaningful, human-readable text identifying the unit, bestie. systemd (and any suitable UIs out there) might use this as a user-visible label for the unit, so this string should identify the unit rather than just describe it β yes, even though the name of the field is literally "Description", okay? π It also should not just repeat the unit name. Good examples that ate: "Apache HTTP Server" or "Postfix Mail Server". Bad examples, do not do this: "high-performance lightweight HTTP server" (way too generic, giving nothing) or "Apache" (meaningless for people who don't know the Apache HTTP server project, plus it duplicates the unit name π).
systemd may use this string as a noun in status messages β like "Starting Description...", "Started Description.", "Reached target Description.", "Failed to start Description." β so it should be capitalized, and it should not be a full sentence, or a phrase with a verb conjugated in the present continuous, or end in a full stop. Bad examples include "exiting the container", "updating the database once per day.", or "OpenSSH server second instance daemon". π
Optional. Type uniline.
π Documentation
A space-separated list of URIs referencing documentation for this unit or its configuration. Accepted are only URIs of the types "http://", "https://", "file:", "info:", "man:". For more information about the syntax of these URIs, see uri(7). π
The URIs should be listed in order of relevance, starting with the most relevant. It is a good idea to first reference documentation that explains what the unit's purpose is, followed by how it is configured, followed by any other related documentation. Obsessed with a well-ordered list, honestly. π
This option may be specified more than once, in which case the specified list of URIs is merged. If the empty string is assigned to this option, the list is reset and all prior assignments will have no effect. Optional. Type list of uniline.
π Wants
Configures (weak) requirement dependencies on other units. This option may be specified more than once, or multiple space-separated units may be specified in one option β in which case dependencies for all listed names will be created. Dependencies of this type may also be configured outside of the unit configuration file by adding a symlink to a .wants/ directory accompanying the unit file. For details, see above.
Units listed in this option will be started if the configuring unit is. However, if the listed units fail to start or cannot be added to the transaction, this has no impact on the validity of the transaction as a whole, and this unit will still be started. This is the recommended way to hook the start-up of one unit to the start-up of another unit. β¨
Note that requirement dependencies do not influence the order in which services are started or stopped. That has to be configured independently with the "After" or "Before" options. If unit "foo.service" pulls in unit "bar.service" as configured with "Wants" and no ordering is configured with "After" or "Before", then both units will be started simultaneously and without any delay between them if "foo.service" is activated. π³
Optional. Type list of uniline.
π₯ Requires
Similar to "Wants", but declares a stronger requirement dependency. Dependencies of this type may also be configured by adding a symlink to a .requires/ directory accompanying the unit file.
If this unit gets activated, the units listed will be activated as well. If one of the other units fails to activate, and an ordering dependency "After" on the failing unit is set, this unit will not be started. Besides, with or without specifying "After", this unit will be stopped (or restarted) if one of the other units is explicitly stopped (or restarted).
Often, it is a better choice to use "Wants" instead of "Requires" in order to achieve a system that is more robust when dealing with failing services. ngl, that's a whole life lesson. π«Ά
Note that this dependency type does not imply that the other unit always has to be in active state when this unit is running. Specifically: failing condition checks (such as "ConditionPathExists", "ConditionPathIsSymbolicLink", β¦ β see below) do not cause the start job of a unit with a "Requires" dependency on it to fail. Also, some unit types may deactivate on their own (for example, a service process may decide to exit cleanly, or a device may be unplugged by the user), which is not propagated to units having a "Requires" dependency. Use the "BindsTo" dependency type together with "After" to ensure that a unit may never be in active state without a specific other unit also in active state (see below).
Optional. Type list of uniline.
π
π Requisite
Similar to "Requires". However, if the units listed here are not started already, they will not be started and the starting of this unit will fail immediately. "Requisite" does not imply an ordering dependency, even if both units are started in the same transaction. Hence this setting should usually be combined with "After", to ensure this unit is not started before the other unit. it's giving "no prerequisites, no entry" π
When "Requisite=b.service" is used on "a.service", this dependency will show as "RequisiteOf=a.service" in property listing of "b.service". "RequisiteOf" dependency cannot be specified directly.
Optional. Type list of uniline.
π BindsTo
Configures requirement dependencies, very similar in style to "Requires". However, this dependency type is stronger: in addition to the effects of "Requires", which already stops (or restarts) the configuring unit when a listed unit is explicitly stopped (or restarted), it also does so when a listed unit stops unexpectedly (which includes when it fails). π
Units can suddenly, unexpectedly enter inactive state for different reasons: the main process of a service unit might terminate on its own choice, the backing device of a device unit might be unplugged, or the mount point of a mount unit might be unmounted without involvement of the system and service manager. chaos, honestly.
When used in conjunction with "After" on the same unit the behaviour of "BindsTo" is even stronger. In this case, the unit bound to strictly has to be in active state for this unit to also be in active state. This not only means a unit bound to another unit that suddenly enters inactive state, but also one that is bound to another unit that gets skipped due to an unmet condition check (such as "ConditionPathExists", "ConditionPathIsSymbolicLink", β¦ β see below) will be stopped, should it be running. Hence, in many cases it is best to combine "BindsTo" with "After". π
When "BindsTo=b.service" is used on "a.service", this dependency will show as "BoundBy=a.service" in property listing of "b.service". "BoundBy" dependency cannot be specified directly.
Optional. Type list of uniline.
π¦ PartOf
Configures dependencies similar to "Requires", but limited to stopping and restarting of units. When systemd stops or restarts the units listed here, the action is propagated to this unit. Note that this is a one-way dependency β changes to this unit do not affect the listed units. periodt. π
When "PartOf=b.service" is used on "a.service", this dependency will show as "ConsistsOf=a.service" in property listing of "b.service". "ConsistsOf" dependency cannot be specified directly.
Optional. Type list of uniline.
π Upholds
Configures dependencies similar to "Wants", but as long as this unit is up, all units listed in "Upholds" are started whenever found to be inactive or failed, and no job is queued for them. While a "Wants" dependency on another unit has a one-time effect when this unit is started, a "Upholds" dependency on it has a continuous effect, constantly restarting the unit if necessary. Obsessed β it never stops showing up for you. π«Ά
This is an alternative to the "Restart" setting of service units, to ensure they are kept running whatever happens. The restart happens without delay, and usual per-unit rate-limit applies.
When "Upholds=b.service" is used on "a.service", this dependency will show as "UpheldBy=a.service" in the property listing of "b.service".
Optional. Type uniline.
βοΈ Conflicts
A space-separated list of unit names. Configures negative requirement dependencies. If a unit has a "Conflicts" requirement on a set of other units, then starting it will stop all of them and starting any of them will stop it. it's giving enemies to enemies π€
Note that this setting does not imply an ordering dependency, similarly to the "Wants" and "Requires" dependencies described above. This means that to ensure that the conflicting unit is stopped before the other unit is started, an "After" or "Before" dependency must be declared. It does not matter which of the two ordering dependencies is used, because stop jobs are always ordered before start jobs, see the discussion in "Before"/"After" below.
If unit A that conflicts with unit B is scheduled to be started at the same time as B, the transaction will either fail (in case both are required parts of the transaction) or be modified to be fixed (in case one or both jobs are not a required part of the transaction). In the latter case, the job that is not required will be removed, or in case both are not required, the unit that conflicts will be started and the unit that is conflicted is stopped. π
Optional. Type list of uniline.
β³ Before
These two settings expect a space-separated list of unit names. They may be specified more than once, in which case dependencies for all listed names are created.
Those two settings configure ordering dependencies between units. If unit "foo.service" contains the setting "Before=bar.service" and both units are being started, "bar.service"'s start-up is delayed until "foo.service" has finished starting up. "After" is the inverse of "Before", i.e. while "Before" ensures that the configured unit is started before the listed unit begins starting up, "After" ensures the opposite, that the listed unit is fully started up before the configured unit is started.
bestie this is only part 1 of 8, do not close the tab, there's so much more coming π
When two units that have an ordering thing going on between them both get shut down, bestie, the start-up order gets flipped. π Like, the inverse. So if a unit is set up with After pointing at another one, the first one gets stopped before the second one when they're both going down.
Now here's the glow-up detail: if you've got two units with any ordering dependency between them, and one gets shut down while the other gets started up, the shutdown is always ordered before the start-up. Doesn't matter if the dependency is After or Before β nope, irrelevant here. Also doesn't matter which of the two is the one being shut down, as long as one is stopping and the other is starting; shutdown goes first in every single case. β¨
And if two units have no ordering dependency at all? They just get shut down or started up at the same time. No ordering happens. Periodt.
When exactly a unit is "done starting up" depends on the unit type β different vibes for different types. Most importantly π: for service units, start-up is considered complete (for the purposes of Before/After) when all its configured start-up commands have been invoked and they either failed or reported start-up success. Heads up, this includes ExecStartPost (or ExecStopPost for the shutdown case). π
Ok important caveat so you don't get confused: those settings are independent of and orthogonal to the requirement dependencies you set with Requires, Wants, Requisite, or BindsTo. A super common pattern is putting the same unit name in both After and Wants, in which case the listed unit gets started before the unit that has these options configured. π«Ά
And one more thing, and this is a real one: Before dependencies on device units have no effect and are not supported. π« Devices generally show up because of an external hotplug event, and systemd creates the matching device unit without delay. Optional. Type list of uniline.
After β¨
These two settings expect a space-separated list of unit names. You can specify them more than once, and if you do, dependencies get created for all the listed names. π
So these two settings configure ordering dependencies between units. Say unit foo.service contains Before=bar.service and both units are being started β then bar.service's start-up is delayed until foo.service has finished starting up. After is literally the inverse of Before: while Before makes sure the configured unit starts before the listed unit even begins starting, After makes sure the listed unit is fully started up before the configured unit starts. π₯
When two units with an ordering dependency between them are shut down, the inverse of the start-up order is applied. I.e. if a unit is configured with After on another unit, the former is stopped before the latter if both are shut down. Given two units with any ordering dependency between them, if one unit is shut down and the other is started up, the shutdown is ordered before the start-up. It does not matter if the ordering dependency is After or Before, in this case. It also does not matter which of the two is shut down, as long as one is shut down and the other is started up; the shutdown is ordered before the start-up in all cases. If two units have no ordering dependencies between them, they are shut down or started up simultaneously, and no ordering takes place. It depends on the unit type when precisely a unit has finished starting up. Most importantly, for service units start-up is considered completed for the purpose of Before/After when all its configured start-up commands have been invoked and they either failed or reported start-up success. Note that this includes ExecStartPost (or ExecStopPost for the shutdown case). πΈ
Note that those settings are independent of and orthogonal to the requirement dependencies as configured by Requires, Wants, Requisite, or BindsTo. It is a common pattern to include a unit name in both the After and Wants options, in which case the unit listed will be started before the unit that is configured with these options. π
Note that Before dependencies on device units have no effect and are not supported. Devices generally become available as a result of an external hotplug event, and systemd creates the corresponding device unit without delay. Optional. Type list of uniline.
OnFailure π
A space-separated list of one or more units that get activated when this unit enters the failed state. Optional. Type uniline.
OnSuccess π
A space-separated list of one or more units that get activated when this unit enters the inactive state. Optional. Type uniline.
PropagatesReloadTo π¦
A space-separated list of one or more units to which reload requests from this unit shall be propagated to, or units from which reload requests shall be propagated to this unit, respectively. Issuing a reload request on a unit will automatically also enqueue reload requests on all units that are linked to it using these two settings. Optional. Type uniline.
ReloadPropagatedFrom π¦
A space-separated list of one or more units to which reload requests from this unit shall be propagated to, or units from which reload requests shall be propagated to this unit, respectively. Issuing a reload request on a unit will automatically also enqueue reload requests on all units that are linked to it using these two settings. Optional. Type uniline.
PropagatesStopTo π
A space-separated list of one or more units to which stop requests from this unit shall be propagated to, or units from which stop requests shall be propagated to this unit, respectively. Issuing a stop request on a unit will automatically also enqueue stop requests on all units that are linked to it using these two settings. Optional. Type uniline.
StopPropagatedFrom π
A space-separated list of one or more units to which stop requests from this unit shall be propagated to, or units from which stop requests shall be propagated to this unit, respectively. Issuing a stop request on a unit will automatically also enqueue stop requests on all units that are linked to it using these two settings. Optional. Type uniline.
JoinsNamespaceOf π§
For units that start processes (like service units), this lists one or more other units whose network and/or temporary file namespace to join. If you set this on a unit β say a.service has JoinsNamespaceOf=b.service β then the inverse dependency (JoinsNamespaceOf=a.service for b.service) is implied. β¨
This only applies to unit types that support the PrivateNetwork, NetworkNamespacePath, PrivateIPC, IPCNamespacePath, and PrivateTmp directives (peep systemd.exec(5) for the details). If a unit that has this setting set gets started, its processes will see the same /tmp/, /var/tmp/, IPC namespace and network namespace as one listed unit that is started. And if multiple listed units are already started and they don't share their namespace, then it is not defined which namespace gets joined. π
Note that this setting only has an effect if PrivateNetwork/NetworkNamespacePath, PrivateIPC/IPCNamespacePath and/or PrivateTmp is enabled for both the unit that joins the namespace and the unit whose namespace is joined. Optional. Type uniline.
RequiresMountsFor π
Takes a space-separated list of absolute paths. Automatically adds dependencies of type Requires and After for all mount units required to access the specified path.
Mount points marked with noauto are not mounted automatically through local-fs.target, but are still honored for the purposes of this option, i.e. they will be pulled in by this unit. Optional. Type uniline.
WantsMountsFor π
Same as RequiresMountsFor, but adds dependencies of type Wants instead of Requires. Optional. Type uniline.
OnSuccessJobMode β
Takes a value of fail, replace, replace-irreversibly, isolate, flush, ignore-dependencies or ignore-requirements. OnFailureJobMode defaults to replace, OnSuccessJobMode defaults to fail. Specifies how the units listed in OnSuccess/OnFailure will be enqueued. See systemctl(1)'s --job-mode= option for details on the possible values. If this is set to isolate, only a single unit may be listed in OnSuccess/OnFailure. Optional. Type uniline.
OnFailureJobMode β
Takes a value of fail, replace, replace-irreversibly, isolate, flush, ignore-dependencies or ignore-requirements. OnFailureJobMode defaults to replace, OnSuccessJobMode defaults to fail. Specifies how the units listed in OnSuccess/OnFailure will be enqueued. See systemctl(1)'s --job-mode= option for details on the possible values. If this is set to isolate, only a single unit may be listed in OnSuccess/OnFailure. Optional. Type uniline.
Note: OnFailureJobMode is migrated with$unitand with: -$unit => "- OnFailureIsolate"
IgnoreOnIsolate π
Takes a boolean argument. If true, this unit will not be stopped when isolating another unit. Defaults to false for service, target, socket, timer, and path units, and true for slice, scope, device, swap, mount, and automount units. Optional. Type boolean.
StopWhenUnneeded π
Takes a boolean argument. If true, this unit will be stopped when it is no longer used. Note that, in order to minimize the work to be executed, systemd will not stop units by default unless they are conflicting with other units, or the user explicitly requested their shut down. If this option is set, a unit will be automatically cleaned up if no other active unit requires it. Defaults to false. Optional. Type boolean.
upstream_default value :
no
RefuseManualStart π
Takes a boolean argument. If true, this unit can only be activated or deactivated indirectly. In this case, explicit start-up or termination requested by the user is denied, however if it is started or stopped as a dependency of another unit, start-up or termination will succeed. This is mostly a safety feature to ensure that the user does not accidentally activate units that are not intended to be activated explicitly, and not accidentally deactivate units that are not intended to be deactivated. These options default to false. Optional. Type boolean.
RefuseManualStop π
Takes a boolean argument. If true, this unit can only be activated or deactivated indirectly. In this case, explicit start-up or termination requested by the user is denied, however if it is started or stopped as a dependency of another unit, start-up or termination will succeed. This is mostly a safety feature to ensure that the user does not accidentally activate units that are not intended to be activated explicitly, and not accidentally deactivate units that are not intended to be deactivated. These options default to false. Optional. Type boolean.
AllowIsolate π
Takes a boolean argument. If "true", this unit may be used with the systemctl isolate command. Otherwise, this will be refused. It probably is a good idea to leave this disabled except for target units that shall be used similar to runlevels in SysV init systems, just as a precaution to avoid unusable system states. This option defaults to "false". Optional. Type boolean.
DefaultDependencies π
Takes a boolean argument. If "yes", (the default), a few default dependencies will implicitly be created for the unit. The actual dependencies created depend on the unit type. For example, for service units, these dependencies ensure that the service is started only after basic system initialization is completed and is properly terminated on system shutdown. See the respective man pages for details. Generally, only services involved with early boot or late shutdown should set this option to "no". It is highly recommended to leave this option enabled for the majority of common units. If set to "no", this option does not disable all implicit dependencies, just non-essential ones. Optional. Type boolean.
SurviveFinalKillSignal π¦
Takes a boolean argument. Defaults to "no". If "yes", processes belonging to this unit will not be sent the final "SIGTERM" and "SIGKILL" signals during the final phase of the system shutdown process. This functionality replaces the older mechanism that allowed a program to set "argv[0][0] = '@'" as described at systemd and Storage Daemons for the Root File System <https://systemd.io/ROOT_STORAGE_DAEMONS>, which however continues to be supported. Optional. Type boolean.
- upstream_default value :
no
CollectMode π§
Tweaks the "garbage collection" algorithm for this unit. Takes one of "inactive" or "inactive-or-failed". If set to "inactive" the unit will be unloaded if it is in the "inactive" state and is not referenced by clients, jobs or other units β however it is not unloaded if it is in the "failed" state. In "failed" mode, failed units are not unloaded until the user invoked systemctl reset-failed on them to reset the "failed" state, or an equivalent command. This behaviour is altered if this option is set to "inactive-or-failed": in this case, the unit is unloaded even if the unit is in a "failed" state, and thus an explicitly resetting of the "failed" state is not necessary. Note that if this mode is used unit results (such as exit codes, exit signals, consumed resources, β¦) are flushed out immediately after the unit completed, except for what is stored in the logging subsystem. Defaults to "inactive". Optional. Type enum. choice: 'inactive', 'inactive-or-failed'.
FailureActionExitStatus π
Controls the exit status to propagate back to an invoking container manager (in case of a system service) or service manager (in case of a user manager) when the "FailureAction"/"SuccessAction" are set to "exit" or "exit-force" and the action is triggered. By default, the exit status of the main process of the triggering unit (if this applies) is propagated. Takes a value in the range 0β¦255 or the empty string to request default behaviour. Optional. Type uniline.
SuccessActionExitStatus β¨
Controls the exit status to propagate back to an invoking container manager (in case of a system service) or service manager (in case of a user manager) when the "FailureAction"/"SuccessAction" are set to "exit" or "exit-force" and the action is triggered. By default, the exit status of the main process of the triggering unit (if this applies) is propagated. Takes a value in the range 0β¦255 or the empty string to request default behaviour. Optional. Type uniline.
JobTimeoutSec β³
"JobTimeoutSec" specifies a timeout for the whole job that starts running when the job is queued. "JobRunningTimeoutSec" specifies a timeout that starts running when the queued job is actually started. If either limit is reached, the job will be cancelled, the unit however will not change state or even enter the "failed" mode.
Both settings take a time span with the default unit of seconds, but other units may be specified, see systemd.time(7). The default is "infinity" (job timeouts disabled), except for device units where "JobRunningTimeoutSec" defaults to "DefaultDeviceTimeoutSec".
Note: these timeouts are independent from any unit-specific timeouts (for example, the timeout set with "TimeoutStartSec" in service units). The job timeout has no effect on the unit itself. Or in other words: unit-specific timeouts are useful to abort unit state changes, and revert them. The job timeout set with this option however is useful to abort only the job waiting for the unit state to change.
Optional. Type uniline.
JobRunningTimeoutSec πΈ
"JobTimeoutSec" specifies a timeout for the whole job that starts running when the job is queued. "JobRunningTimeoutSec" specifies a timeout that starts running when the queued job is actually started. If either limit is reached, the job will be cancelled, the unit however will not change state or even enter the "failed" mode.
Both settings take a time span with the default unit of seconds, but other units may be specified, see systemd.time(7). The default is "infinity" (job timeouts disabled), except for device units where "JobRunningTimeoutSec" defaults to "DefaultDeviceTimeoutSec".
Note: these timeouts are independent from any unit-specific timeouts (for example, the timeout set with "TimeoutStartSec" in service units). The job timeout has no effect on the unit itself. Or in other words: unit-specific timeouts are useful to abort unit state changes, and revert them. The job timeout set with this option however is useful to abort only the job waiting for the unit state to change.
Optional. Type uniline.
JobTimeoutAction π₯
"JobTimeoutAction" optionally configures an additional action to take when the timeout is hit, see description of "JobTimeoutSec" and "JobRunningTimeoutSec" above. It takes the same values as "FailureAction"/"SuccessAction". Defaults to "none".
"JobTimeoutRebootArgument" configures an optional reboot string to pass to the reboot(2) system call. Optional. Type uniline.
JobTimeoutRebootArgument π₯
"JobTimeoutAction" optionally configures an additional action to take when the timeout is hit, see description of "JobTimeoutSec" and "JobRunningTimeoutSec" above. It takes the same values as "FailureAction"/"SuccessAction". Defaults to "none".
"JobTimeoutRebootArgument" configures an optional reboot string to pass to the reboot(2) system call. Optional. Type uniline.
StartLimitAction π¨
Configure an additional action to take if the rate limit configured with "StartLimitIntervalSec" and "StartLimitBurst" is hit. Takes the same values as the "FailureAction"/"SuccessAction" settings. If "none" is set, hitting the rate limit will trigger no action except that the start will not be permitted. Defaults to "none". Optional. Type enum. choice: 'exit', 'exit-force', 'halt', 'halt-force', 'halt-immediate', 'kexec', 'kexec-force', 'none', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'reboot', 'reboot-force', 'reboot-immediate', 'soft-reboot', 'soft-reboot-force'.
SourcePath π
A path to a configuration file this unit has been generated from. This is primarily useful for implementation of generator tools that convert configuration from an external configuration file format into native unit files. This functionality should not be used in normal units. Optional. Type uniline.
ConditionArchitecture ποΈ
Check whether the system is running on a specific architecture. Takes one of "x86", "x86-64", "ppc", "ppc-le", "ppc64", "ppc64-le", "ia64", "parisc", "parisc64", "s390", "s390x", "sparc", "sparc64", "mips", "mips-le", "mips64", "mips64-le", "alpha", "arm", "arm-be", "arm64", "arm64-be", "sh", "sh64", "m68k", "tilegx", "cris", "arc", "arc-be", or "native".
Use systemd-analyze(1) for the complete list of known architectures.
The architecture is determined from the information returned by uname(2) and is thus subject to personality(2). Note that a "Personality" setting in the same unit file has no effect on this condition. A special architecture name "native" is mapped to the architecture the system manager itself is compiled for. The test may be negated by prepending an exclamation mark. Optional. Type list of enum.
ConditionFirmware π₯οΈ
Check whether the system's firmware is of a certain type. The following values are possible: Optional. Type list of uniline.
ConditionVirtualization πΎ
Check whether the system is executed in a virtualized environment and optionally test whether it is a specific implementation. Takes either boolean value to check if being executed in any virtualized environment, or one of "vm" and "container" to test against a generic type of virtualization solution, or one of "qemu", "kvm", "amazon", "zvm", "vmware", "microsoft", "oracle", "powervm", "xen", "bochs", "uml", "bhyve", "qnx", "apple", "sre", "openvz", "lxc", "lxc-libvirt", "systemd-nspawn", "docker", "podman", "rkt", "wsl", "proot", "pouch", "acrn" to test against a specific implementation, or "private-users" to check whether we are running in a user namespace. See systemd-detect-virt(1) for a full list of known virtualization technologies and their identifiers. If multiple virtualization technologies are nested, only the innermost is considered. The test may be negated by prepending an exclamation mark. Optional. Type list of uniline.
ConditionHost π
"ConditionHost" may be used to match against the hostname, machine ID, boot ID or product UUID of the host. This either takes a hostname string (optionally with shell style globs) which is tested against the locally set hostname as returned by gethostname(2), or a 128bit ID or UUID, formatted as string. The latter is compared against machine ID, boot ID and the firmware product UUID if there is any. See machine-id(5) for details about the machine ID. The test may be negated by prepending an exclamation mark. Optional. Type list of uniline.
ConditionKernelCommandLine π§
"ConditionKernelCommandLine" may be used to check whether a specific kernel command line option is set (or if prefixed with the exclamation mark β unset). The argument must either be a single word, or an assignment (i.e. two words, separated by "="). In the former case the kernel command line is searched for the word appearing as is, or as left hand side of an assignment. In the latter case, the exact assignment is looked for with right and left hand side matching. This operates on the kernel command line communicated to userspace via "/proc/cmdline", except when the service manager is invoked as payload of a container manager, in which case the command line of PID 1 is used instead (i.e. "/proc/1/cmdline"). Optional. Type list of uniline.
ConditionKernelVersion
so ConditionKernelVersion is your little "hey does this kernel even" checker π
it looks at the kernel version (the thing uname -r spits out) and asks: does it match this expression, or (if you slap a ! in front) does it not match. The argument has to be a list of (potentially quoted) expressions, bestie β a whole list, not just one.
Each expression starts with one of these operators:
=or!=β for string comparisons<,<=,==,<>,>=,>β for version comparisons$=,!$=β for a shell-style glob match
and if you're feeling lazy and don't specify an operator at all, $= is implied. no cap.
okay but real talk β οΈ using the kernel version string to figure out what features a kernel supports is unreliable. why? because literally everyone backports drivers, features and fixes from newer upstream kernels into older distro kernels. so this check is inherently unportable and you should not use it for units that might land on different distributions. π
Optional. Type list of uniline.
ConditionVersion
ConditionVersion is the glow-up version of the above β¨ it checks whether a software version matches an expression, or doesn't match if you prefix it with !. The first argument is the software whose version you're checking β right now kernel, systemd and glibc are supported. Omit that first argument and kernel is implied, easy.
The second argument must be a list of (potentially quoted) expressions. Each one starts with:
=or!=β string comparisons<,<=,==,<>,>=,>β version comparisons$=,!$=β shell-style glob match
No operator? $= is implied, again. π
Optional. Type list of uniline.
ConditionCredential
ConditionCredential checks whether a credential with the name you give was passed into the service manager π the details live in the System and Service Credentials docs at https://systemd.io/CREDENTIALS.
- in services for the system service manager β conditionalize services based on system credentials passed in
- in services for the per-user service manager β conditionalize services based on credentials passed into the
unit@.serviceservice instance belonging to the user
The argument must be a valid credential name. Optional. Type list of uniline.
ConditionEnvironment
ConditionEnvironment vibe checks whether a specific environment variable is set (or, prefixed with !, unset) in the service manager's environment block πΈ the argument can be:
- a single word β checks if the variable with that name is defined in the environment block
- an assignment (
name=value) β checks if the variable with that exact value is defined
and here's the important bit, bestie: it's the service manager's own environment block being checked. not any variables defined with Environment or EnvironmentFile, mkay? this is especially useful when the service manager is running inside a containerized environment, or as a per-user service manager, because then you can check for variables passed in by the enclosing container manager or PAM. iconic behavior.
Optional. Type list of uniline.
ConditionSecurity
ConditionSecurity checks whether the given security technology is enabled on the system π₯ currently, the following values are recognized:
The test may be negated by prepending an exclamation mark. Optional. Type list of uniline.
ConditionCapability
checks whether the given capability exists in the capability bounding set of the service manager π and no, it does not check whether the capability is actually available in the permitted or effective sets β peep capabilities(7) for the deets. you pass a capability name like CAP_MKNOD, and you can prefix it with an exclamation mark to negate the check. Optional. Type list of uniline.
ConditionACPower
checks whether the system has AC power, or is exclusively battery powered, at the moment the unit gets activated π takes a boolean argument:
trueβ condition holds only if at least one AC connector of the system is connected to a power source, or if no AC connectors are knownfalseβ condition holds only if there is at least one AC connector known and all AC connectors are disconnected from a power source
Optional. Type list of uniline.
ConditionNeedsUpdate
takes one of /var/ or /etc/ as its argument, possibly prefixed with a ! to invert the condition π¦ this one lets you conditionalize units on whether that directory needs an update, because /usr/'s modification time is newer than the stamp file .updated in the directory you named.
super useful for offline updates of the vendor OS resources in /usr/ that require updating /etc/ or /var/ on the next boot. and heads up: units using this condition should order themselves before systemd-update-done.service(8) so they definitely run before the stamp file's modification time gets reset (which is what signals a completed update).
If the systemd.condition_needs_update= option is specified on the kernel command line (it takes a boolean), it will override the result of this condition check and takes precedence over any file modification time checks. And if that kernel command line option is used, systemd-update-done.service won't have immediate effect on any following ConditionNeedsUpdate checks until the system reboots without the kernel command line option specified anymore.
π quick notes so this scheme actually works:
- the timestamp of
/usr/should be explicitly updated after its contents are modified. the kernel automatically updates modification timestamps on a directory only when immediate children of a directory are modified β modifying nested files will not automatically update the mtime of/usr/. - if your update method includes a call to execute the appropriate post-update steps itself, it should not touch the timestamp of
/usr/. in a typical distribution packaging scheme, packages do any required update steps as part of installation or upgrade, so package contents are immediately usable.ConditionNeedsUpdateshould be used with other update mechanisms, where that kind of immediate update doesn't happen.
Optional. Type list of enum.
ConditionFirstBoot
takes a boolean argument, and it conditionalizes units on whether the system is booting up for the first time π roughly meaning /etc/ was unpopulated when the system started booting (for details, see "First Boot Semantics" in machine-id(5)). First Boot is considered finished β so this condition evaluates as false β after the manager has finished the startup phase.
use it to populate /etc/ on the first boot after a factory reset, or when a new system instance boots up for the very first time. β¨
no cap, the service manager itself does setup steps during First Boot: it initializes machine-id(5) and presets all units, enabling or disabling them according to the systemd.preset(5) settings. additional setup can be done via units with ConditionFirstBoot=yes.
for robustness, units with ConditionFirstBoot=yes should order themselves before first-boot-complete.target and pull in this passive target with Wants. that way, if the first boot gets aborted, those units get re-run during the next system startup. π«Ά
If the systemd.condition_first_boot= option is specified on the kernel command line (taking a boolean), it will override the result of this condition check, taking precedence over /etc/machine-id existence checks. Optional. Type list of boolean.
ConditionPathExists
checks for the existence of a file π if the specified absolute path name doesn't exist, the condition fails. and if the absolute path name you pass to ConditionPathExists is prefixed with an exclamation mark (!), the test is negated β so the unit is only started if the path does not exist. Optional. Type list of uniline.
ConditionPathExistsGlob
ConditionPathExistsGlob is like ConditionPathExists, but it checks for the existence of at least one file or directory matching the specified globbing pattern π Optional. Type list of uniline.
ConditionPathIsDirectory
ConditionPathIsDirectory is like ConditionPathExists but it verifies that a certain path exists and is a directory π Optional. Type list of uniline.
ConditionPathIsSymbolicLink
ConditionPathIsSymbolicLink is like ConditionPathExists but it verifies that a certain path exists and is a symbolic link π Optional. Type list of uniline.
ConditionPathIsMountPoint
ConditionPathIsMountPoint is like ConditionPathExists but it verifies that a certain path exists and is a mount point π½ Optional. Type list of uniline.
ConditionPathIsReadWrite
ConditionPathIsReadWrite is like ConditionPathExists but it verifies that the underlying file system is readable and writable β i.e. not mounted read-only βοΈ Optional. Type list of uniline.
ConditionPathIsEncrypted
ConditionPathIsEncrypted is like ConditionPathExists but it verifies that the underlying file system's backing block device is encrypted using dm-crypt/LUKS π
β οΈ read this twice, bestie:
- this check does not cover ext4 per-directory encryption β it only detects block level encryption
- if the specified path resides on a file system on top of a loopback block device, only encryption above the loopback device is detected. whether the file system backing the loopback block device is encrypted is not detected.
Optional. Type list of uniline.
ConditionPathIsSocket
ConditionPathIsSocket is like ConditionPathExists but it verifies that a certain path exists and is a socket 𧦠Optional. Type list of uniline.
ConditionDirectoryNotEmpty
ConditionDirectoryNotEmpty is like ConditionPathExists but it verifies that a certain path exists and is a non-empty directory π Optional. Type list of uniline.
ConditionFileNotEmpty
ConditionFileNotEmpty is like ConditionPathExists but it verifies that a certain path exists and refers to a regular file with a non-zero size π Optional. Type list of uniline.
ConditionFileIsExecutable
ConditionFileIsExecutable is like ConditionPathExists but it verifies that a certain path exists, is a regular file, and is marked executable β‘ Optional. Type list of uniline.
ConditionUser
ConditionUser takes a numeric UID, a UNIX user name, or the special value @system π it checks whether the service manager is running as the given user. the special value @system checks if the user id is within the system user range.
π psst β this option is not useful for system services, because the system manager exclusively runs as the root user, so the test result is just constant. RIP.
Optional. Type list of uniline.
ConditionGroup
Bestie, this is ConditionUser's sibling π
β same energy, different check. It verifies that the service manager's real or effective group, or any of its auxiliary groups, matches the group or GID you named. And no, this one does not support the special value @system. Periodt.
Optional. Type: list of uniline.
ConditionControlGroupController
This one's asking: are the cgroup controllers you want (like cpu) actually available to use on this system, and is it running the legacy v1 cgroup hierarchy or the modern v2 one? π§
You can pass multiple controllers, just separate them with a space β and here's the catch, the condition only passes if all the listed controllers are available. Controllers that systemd doesn't know about are justβ¦ ignored, no biggie. The valid controllers are cpu, io, memory, and pids.
Lowkey important: even if a controller is available in the kernel, it might not actually be available if it was disabled on the kernel command line with cgroup_disable=controller. π
Alternatively, you can name two special strings β v1 and v2 β with no controller names at all. v2 passes if the unified v2 cgroup hierarchy is used, and v1 passes if the legacy v1 hierarchy or the hybrid hierarchy is used. Note that legacy and hybrid hierarchies have been deprecated (rip bestie πͺ¦). See systemd(1) for more info.
Optional. Type: list of uniline.
ConditionMemory
Verify that the specified amount of system memory is available to the current system. Takes a memory size in bytes as its argument, optionally prefixed with a comparison operator: <, <=, = (or ==), != (or <>), >=, >.
On bare-metal systems it compares the amount of physical memory in the system against the specified size, adhering to whatever comparison operator you gave it. In containers, though, it compares the amount of memory assigned to the container instead. β¨
Optional. Type: list of uniline.
ConditionCPUs
Verify that the specified number of CPUs is available to the current system. Takes a number of CPUs as its argument, optionally prefixed with a comparison operator: <, <=, = (or ==), != (or <>), >=, >.
It compares the number of CPUs in the CPU affinity mask configured of the service manager itself against the specified number, adhering to the operator you supplied. On physical systems, the number of CPUs in the service manager's affinity mask usually matches the number of physical CPUs β but in special and virtual environments it might differ. In particular, in containers the affinity mask usually matches the number of CPUs assigned to the container, not the physically available ones. π¦
Optional. Type: list of uniline.
ConditionCPUFeature
Verify that a given CPU feature is available via the CPUID instruction. Heads up: this condition only does something on i386 and x86-64 processors. On any other processor, it's assumed the CPU does not support the given feature. It checks the leaves 1, 7, 0x80000001, and 0x80000007.
The valid values are: fpu, vme, de, pse, tsc, msr, pae, mce, cx8, apic, sep, mtrr, pge, mca, cmov, pat, pse36, clflush, mmx, fxsr, sse, sse2, ht, pni, pclmul, monitor, ssse3, fma3, cx16, sse4_1, sse4_2, movbe, popcnt, aes, xsave, osxsave, avx, f16c, rdrand, bmi1, avx2, bmi2, rdseed, adx, sha_ni, syscall, rdtscp, lm, lahf_lm, abm, constant_tsc.
Optional. Type: list of uniline.
ConditionOSRelease
Verify that a specific key=value pair is set in the host's os-release(5). π
Besides exact string matching (with = and !=), relative comparisons are supported for versioned parameters (e.g. VERSION_ID; with <, <=, ==, <>, >=, >), and shell-style wildcard comparisons (*, ?, []) are supported with the $= (match) and !$= (non-match).
If the given key is not found in the file, the match is done against an empty value.
Optional. Type: list of uniline.
ConditionMemoryPressure
Verify that the overall system pressure (memory, CPU or IO) is below or equal to a threshold. This setting takes a threshold value as its argument. It can be specified as a simple percentage value, suffixed with % β in which case the pressure is measured as an average over the last five minutes before the attempt to start the unit is performed. π«
Alternatively, you can specify the average timespan too, using / as a separator, for example: 10%/1min. The supported timespans match what the kernel provides, and are limited to 10sec, 1min and 5min. The full PSI gets checked first, and if it's not found then some gets checked. For more details, see the documentation on PSI (Pressure Stall Information) https://docs.kernel.org/accounting/psi.html.
Optionally, the threshold value can be prefixed with the slice unit under which the pressure will be checked, followed by a :. If the slice unit is not specified, the overall system pressure is measured instead of a particular cgroup's.
Optional. Type: list of uniline.
ConditionCPUPressure
Verify that the overall system pressure (memory, CPU or IO) is below or equal to a threshold. This setting takes a threshold value as its argument. It can be specified as a simple percentage value, suffixed with % β in which case the pressure is measured as an average over the last five minutes before the attempt to start the unit is performed. π
Alternatively, you can specify the average timespan too, using / as a separator, for example: 10%/1min. The supported timespans match what the kernel provides, and are limited to 10sec, 1min and 5min. The full PSI gets checked first, and if it's not found then some gets checked. For more details, see the documentation on PSI (Pressure Stall Information) https://docs.kernel.org/accounting/psi.html.
Optionally, the threshold value can be prefixed with the slice unit under which the pressure will be checked, followed by a :. If the slice unit is not specified, the overall system pressure is measured instead of a particular cgroup's.
Optional. Type: list of uniline.
ConditionIOPressure
Verify that the overall system pressure (memory, CPU or IO) is below or equal to a threshold. This setting takes a threshold value as its argument. It can be specified as a simple percentage value, suffixed with % β in which case the pressure is measured as an average over the last five minutes before the attempt to start the unit is performed. π
Alternatively, you can specify the average timespan too, using / as a separator, for example: 10%/1min. The supported timespans match what the kernel provides, and are limited to 10sec, 1min and 5min. The full PSI gets checked first, and if it's not found then some gets checked. For more details, see the documentation on PSI (Pressure Stall Information) https://docs.kernel.org/accounting/psi.html.
Optionally, the threshold value can be prefixed with the slice unit under which the pressure will be checked, followed by a :. If the slice unit is not specified, the overall system pressure is measured instead of a particular cgroup's.
Optional. Type: list of uniline.
ConditionKernelModuleLoaded
Test whether the specified kernel module has been loaded and is already fully initialized. π«Ά
Optional. Type: list of uniline.
AssertArchitecture
Okay so this is where things get β¨ spicy β¨ and honestly a little dramatic. Similar to the ConditionArchitecture, ConditionVirtualization, β¦ condition settings described above, these settings add assertion checks to the start-up of the unit. But unlike the condition settings, if an assertion setting is not met, it results in failure of the start job β which means this gets logged loudly. π’
Note that hitting a configured assertion does not cause the unit to enter the failed state (or in fact result in any state change of the unit) β it affects only the job queued for it.
Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into.
Optional. Type: uniline.
AssertVirtualization
Same vibe as before, bestie: like the ConditionArchitecture, ConditionVirtualization, β¦ condition settings up above, these settings tack assertion checks onto the start-up of the unit. The difference from plain conditions? Any assertion setting that isn't met fails the start job β and yeah, that's logged loudly. π³
Hitting a configured assertion does not put the unit into the failed state (nor does it cause any state change of the unit at all) β it only affects the job queued for it.
Reach for assertion expressions when a unit literally cannot operate without certain requirements, and when it's something the administrator or user should look into.
Optional. Type: uniline.
AssertHost
You already know the drill π
β like the ConditionArchitecture, ConditionVirtualization, β¦ condition settings described above, these settings add assertion checks to the start-up of the unit. Unlike the conditions, though, any assertion setting that isn't met results in failure of the start job, which gets logged loudly.
And again: hitting a configured assertion does not cause the unit to enter the failed state (or actually change the unit's state in any way) β the only thing affected is the job queued for it.
Use these when a unit can't operate without certain requirements being met, and when the administrator or user should be the one to look into it.
Optional. Type: uniline.
AssertKernelCommandLine
Like the ConditionArchitecture, ConditionVirtualization, β¦ condition settings described above, these settings add assertion checks to the unit's start-up. But unlike the condition settings, any assertion setting that isn't met fails the start job β logged loudly, no cap. π₯
Note that hitting a configured assertion does not cause the unit to enter the failed state (it doesn't result in any state change of the unit at all) β it affects only the job queued for it.
Save assertion expressions for units that cannot operate when specific requirements aren't met, and for when this is something the administrator or user should look into.
Optional. Type: uniline.
AssertKernelVersion
Same rules as all her sisters above β like the ConditionArchitecture, ConditionVirtualization, β¦ condition settings, these settings add assertion checks to the start-up of the unit. And unlike the conditions settings, any assertion setting that isn't met results in failure of the start job, which is logged loudly. π
Reminder: hitting a configured assertion does not cause the unit to enter the failed state (nor does it result in any state change of the unit) β it only affects the job queued for it.
Use assertion expressions for units that can't operate when specific requirements aren't met, and when this is something the administrator or user should look into.
Optional. Type: uniline.
AssertVersion π
okay so, plot twist: all these Assertβ¦ settings are basically the condition settings' loud cousin π
. Just like ConditionArchitecture, ConditionVirtualization, β¦ (all those condition settings we covered above), they add assertion checks to the start-up of the unit. The tea though? A condition that isn't met is all "whatever, skip it." An assertion that isn't met makes the start job fail, and it gets logged loudly β everyone's gonna hear about it π.
One major caveat bestie: hitting a configured assertion does not push the unit into the failed state, and honestly it doesn't cause any state change of the unit at all. It only affects the job queued for it. Use assertion expressions for units that genuinely can't operate unless specific requirements are met, and when that's something the administrator or user should be looking into. Optional. Type uniline.
AssertCredential β¨
Same family as ConditionArchitecture, ConditionVirtualization, β¦ β those condition settings above β except these ones add assertion checks to the start-up of the unit π. And unlike conditions, if an assertion setting isn't met, the start job fails, and yes it's logged loudly π.
But wait, don't panic: hitting a configured assertion does not make the unit enter the failed state, and it doesn't cause any state change of the unit either. It affects only the job queued for it. Reach for assertion expressions for units that cannot operate when specific requirements aren't met, and when this is something the administrator or user should look into. Optional. Type uniline.
AssertEnvironment π¦
Think of ConditionArchitecture, ConditionVirtualization, β¦ up there β same vibe, but with teeth. These settings add assertion checks to the start-up of the unit, and unlike the condition settings, any assertion setting that isn't met results in failure of the start job (which means it is logged loudly, no cap) π₯.
Also PSA: hitting a configured assertion does not cause the unit to enter the failed state β in fact it results in no state change of the unit whatsoever. It only affects the job queued for it. Use assertion expressions when a unit can't operate without specific requirements being met, and when the administrator or user should really look into it. Optional. Type uniline.
AssertSecurity πΈ
Just like ConditionArchitecture, ConditionVirtualization, β¦, those condition settings described above, these settings add assertion checks to the start-up of the unit π. The difference from conditions? Any assertion setting that is not met results in failure of the start job, and it's logged loudly β it's giving "callout post" energy, ngl.
Important: hitting a configured assertion does not cause the unit to enter the failed state (or actually result in any state change of the unit at all). It affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
AssertCapability π
okay so same energy as ConditionArchitecture, ConditionVirtualization, β¦ (the condition settings from above) π β these add assertion checks to the start-up of the unit, but unlike the conditions, an assertion setting that isn't met = failure of the start job, and yep, it's logged loudly π£.
And the plot twist: hitting a configured assertion does not cause the unit to enter the failed state, and it doesn't result in any state change of the unit either β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
AssertACPower π
These are twinning with ConditionArchitecture, ConditionVirtualization, β¦ β those condition settings described above β cos they add assertion checks to the start-up of the unit β¨. Except unlike conditions, an unmet assertion setting results in failure of the start job, which means it is logged loudly fr fr π.
Heads up though: hitting a configured assertion does not cause the unit to enter the failed state (nor does it result in any state change of the unit). It affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
AssertNeedsUpdate β
Bestie, same situation as ConditionArchitecture, ConditionVirtualization, β¦ above: these settings add assertion checks to the start-up of the unit π«Ά. The condition settings let stuff slide; the assertion settings do not β any assertion setting that is not met results in failure of the start job (which means this is logged loudly) π.
Caveat time: hitting a configured assertion does not cause the unit to enter the failed state (or in fact result in any state change of the unit) β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
AssertFirstBoot π
Copy that energy from ConditionArchitecture, ConditionVirtualization, β¦ β those condition settings a few scrolls up β cos these add assertion checks to the start-up of the unit πΈ. Unlike the conditions, though, any assertion setting that isn't met makes the start job fail, and it's logged loudly (dramatic? yes. deserved? also yes) π.
Note the fine print: hitting a configured assertion does not cause the unit to enter the failed state, and it results in no state change of the unit β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
AssertPathExists π₯
Similar to ConditionArchitecture, ConditionVirtualization, β¦, those condition settings described up above, these settings add assertion checks to the start-up of the unit π. But unlike the conditions, an assertion setting that is not met results in failure of the start job, which means it is logged loudly β the whole timeline is gonna know π.
And ngl, hitting a configured assertion does not cause the unit to enter the failed state (or in fact result in any state change of the unit at all) β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
AssertPathExistsGlob π
So these are basically ConditionArchitecture, ConditionVirtualization, β¦ (yeah, those condition settings from above) but with consequences β¨. They add assertion checks to the start-up of the unit, and unlike the condition settings, any assertion setting that is not met = failure of the start job, and it's logged loudly π’.
Quick reminder though: hitting a configured assertion does not cause the unit to enter the failed state, nor does it result in any state change of the unit β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
AssertPathIsDirectory π¦
Just like the ConditionArchitecture, ConditionVirtualization, β¦ condition settings described above, these settings add assertion checks to the start-up of the unit π. The big difference: an assertion setting that is not met results in failure of the start job β logged loudly, bestie, not subtle at all π
.
Also don't forget: hitting a configured assertion does not cause the unit to enter the failed state (or in fact result in any state change of the unit). It affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
AssertPathIsSymbolicLink π
okay so these are the siblings of ConditionArchitecture, ConditionVirtualization, β¦ β the condition settings we already talked about above β and they add assertion checks to the start-up of the unit πΈ. Unlike the conditions, if any assertion setting isn't met, the start job fails (and yeah, it is logged loudly) π¨.
Careful though: hitting a configured assertion does not cause the unit to enter the failed state, and it doesn't result in any state change of the unit either β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
AssertPathIsMountPoint π
These run parallel to ConditionArchitecture, ConditionVirtualization, β¦ (those condition settings from before), adding assertion checks to the start-up of the unit β¨. Where conditions are chill, assertions are not: any assertion setting that is not met results in failure of the start job, which means it is logged loudly π.
And fr, hitting a configured assertion does not cause the unit to enter the failed state (or in fact result in any state change of the unit) β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
AssertPathIsReadWrite π
Same deal as ConditionArchitecture, ConditionVirtualization, β¦ β those condition settings described above β these settings add assertion checks to the start-up of the unit π. But unlike the conditions, any assertion setting that isn't met results in failure of the start job (which means this is logged loudly, no secrets kept) π.
Also PSA: hitting a configured assertion does not cause the unit to enter the failed state, and it doesn't result in any state change of the unit β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
AssertPathIsEncrypted π§
just like ConditionArchitecture, ConditionVirtualization, β¦ (the condition settings above), these settings add assertion checks to the start-up of the unit π«Ά. The twist vs. conditions: any assertion setting that is not met results in failure of the start job, and yes it is logged loudly π₯.
Tiny but mighty caveat: hitting a configured assertion does not cause the unit to enter the failed state (or in fact result in any state change of the unit) β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
π
AssertPathIsSocket π
Okay so this is a sibling of the ConditionArchitecture, ConditionVirtualization, β¦, condition settings we talked about up above β same family, it adds an assertion check to the start-up of the unit. But conditions and assertions are NOT the same vibe. If an assertion isn't met, the start job fails, and it fails loudly (the whole thing gets logged hard). And listen: tripping a configured assertion does not throw the unit into the "failed" state, and honestly it doesn't cause any state change of the unit at all β it only affects the job that got queued for it. Reach for assertion expressions when your unit literally cannot operate unless specific requirements are met, and when this is the kind of thing the administrator or user should look into. Optional. Type uniline.
π¦ AssertDirectoryNotEmpty π¦
Like ConditionArchitecture, ConditionVirtualization, β¦, those condition settings from earlier, this adds an assertion check onto the unit's start-up. Except β and this is the plot twist β with conditions, whatever, but with assertions, if it's not met the start job fails, and it's logged loudly. π Hitting a configured assertion does not put the unit into the "failed" state, and fr it doesn't result in any state change of the unit β it only touches the job queued for it. Use assertion expressions for units that can't operate when specific requirements aren't met, and when this is something the administrator or user should look into. Optional. Type uniline.
β¨ AssertFileNotEmpty β¨
Bestie, same deal as ConditionArchitecture, ConditionVirtualization, β¦, the condition settings described above: this setting bolts assertion checks onto the start-up of the unit. Unlike the condition ones though, an assertion that isn't met means the start job fails, which means it's logged loudly, no subtlety. Note β and don't skip this part β hitting a configured assertion doesn't make the unit enter the "failed" state, and it doesn't cause any state change of the unit either; it only affects the job queued for it. Assertion expressions are the move for units that cannot operate when specific requirements aren't met, and when this is something the administrator or user should look into. Optional. Type uniline.
π AssertFileIsExecutable π
Same as the ConditionArchitecture, ConditionVirtualization, β¦, condition settings above β it adds assertion checks to the start-up of the unit. The difference from conditions? If an assertion setting isn't met, the start job fails, which means it gets logged loudly. π And: hitting a configured assertion does not cause the unit to enter the "failed" state, nor does it actually result in any state change of the unit β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
πΈ AssertUser πΈ
Just like ConditionArchitecture, ConditionVirtualization, β¦, those condition settings described above β assertion checks, added to the start-up of the unit. But here's the thing: unlike conditions, if an assertion setting isn't met the start job fails, and that failure is logged loudly. Also worth knowing: hitting a configured assertion does not cause the unit to enter the "failed" state, and in fact it doesn't result in any state change of the unit β it only affects the job queued for it. Use assertion expressions when your unit can't operate without specific requirements being met, and when this is something the administrator or user should look into. Optional. Type uniline.
π«Ά AssertGroup π«Ά
This one is similar to the ConditionArchitecture, ConditionVirtualization, β¦, condition settings we covered above β it adds assertion checks to the unit's start-up. Unlike the condition settings, though, any assertion setting that isn't met results in the start job failing (and yes, logged loudly). Heads up: hitting a configured assertion does not cause the unit to enter the "failed" state β or in fact result in any state change of the unit β it affects only the job queued for it. Reach for assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
π AssertControlGroupController π
Similar to ConditionArchitecture, ConditionVirtualization, β¦, the condition settings above, this adds assertion checks to the start-up of the unit. Unlike the conditions settings, an assertion setting that isn't met makes the start job fail, which means this is logged loudly. π₯ Note that hitting a configured assertion doesn't cause the unit to enter the "failed" state, nor does it result in any state change of the unit β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
π AssertMemory π
Like the ConditionArchitecture, ConditionVirtualization, β¦, condition settings described above, these settings add assertion checks to the start-up of the unit. However, unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this gets logged loudly). And don't forget β hitting a configured assertion does not cause the unit to enter the "failed" state, and in fact doesn't result in any state change of the unit at all; it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
π AssertCPUs π
Similar in spirit to ConditionArchitecture, ConditionVirtualization, β¦, the condition settings above: assertion checks, added to the start-up of the unit. Unlike conditions, if an assertion setting isn't met, the start job fails β logged loudly, obviously. Keep in mind that hitting a configured assertion does not cause the unit to enter the "failed" state (or, like, result in any state change of the unit whatsoever) β it only affects the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
β AssertCPUFeature β
Same pattern as ConditionArchitecture, ConditionVirtualization, β¦, the condition settings described above β assertion checks get added to the unit's start-up. But unlike the conditions settings, if an assertion setting isn't met the start job fails, and that gets logged loudly. Also: hitting a configured assertion does not cause the unit to enter the "failed" state, and in fact results in no state change of the unit β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
π AssertOSRelease π
Similar to ConditionArchitecture, ConditionVirtualization, β¦, those condition settings from above β these settings add assertion checks to the start-up of the unit. Unlike the conditions settings though, any assertion setting that isn't met means the start job fails (which means, yep, logged loudly). Note that hitting a configured assertion doesn't cause the unit to enter the "failed" state, or in fact result in any state change of the unit β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
π§ AssertMemoryPressure π§
Like ConditionArchitecture, ConditionVirtualization, β¦, the condition settings described above, this setting adds assertion checks to the start-up of the unit. Unlike the conditions settings: if an assertion setting isn't met, the start job fails, and it's logged loudly. π£οΈ Also β hitting a configured assertion does not cause the unit to enter the "failed" state, nor does it result in any state change of the unit; it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
π AssertCPUPressure π
Similar to the ConditionArchitecture, ConditionVirtualization, β¦, condition settings described above β assertion checks, bolted onto the start-up of the unit. Unlike conditions, any assertion setting that is not met results in failure of the start job, which means it's logged loudly. Note that hitting a configured assertion does not cause the unit to enter the "failed" state, and doesn't result in any state change of the unit at all β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
π AssertIOPressure π
Similar to ConditionArchitecture, ConditionVirtualization, β¦, the condition settings above, these settings add assertion checks to the start-up of the unit. But unlike the conditions settings, an assertion setting that isn't met results in the start job failing β and yes, that's logged loudly. Heads up: hitting a configured assertion does not cause the unit to enter the "failed" state, and in fact results in no state change of the unit β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
π₯ AssertKernelModuleLoaded π₯
Similar to the ConditionArchitecture, ConditionVirtualization, β¦, condition settings described above β assertion checks, added to the start-up of the unit. Unlike the conditions settings, if an assertion setting isn't met the start job fails, which means this is logged loudly. Note that hitting a configured assertion does not cause the unit to enter the "failed" state, or in fact result in any state change of the unit β it affects only the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when this is something the administrator or user should look into. Optional. Type uniline.
π StartLimitInterval π
Deprecated. Optional. Type uniline.
Deprecated, bestie β it's giving "please don't use me." The original really said nothing more about it, so neither will I. π
OnFailureIsolate
Bestie, this one is on its way out the door β it's flagged Deprecated. Optional. Type uniline.
FailureAction
So this is the "what do we do when things go sideways" knob π« β you use it to configure the action to take when the unit stops and enters a failed state or inactive state. It takes one of none, reboot, reboot-force, reboot-immediate, poweroff, poweroff-force, poweroff-immediate, exit, exit-force, soft-reboot, soft-reboot-force, kexec, kexec-force, halt, halt-force and halt-immediate. In system mode, all options are allowed. In user mode, only none, exit, and exit-force are allowed. Both options default to none.
Now the tour, because each of these does something very specific:
noneβ nothing gets triggered at all, chill vibes, no action. β¨rebootβ causes a reboot following the normal shutdown procedure (i.e. equivalent tosystemctl reboot).reboot-forceβ causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent tosystemctl reboot -f).reboot-immediateβ causes immediate execution of thereboot(2)system call, which might result in data loss (i.e. equivalent tosystemctl reboot -ff). π
Similarly, poweroff, poweroff-force, poweroff-immediate, kexec, kexec-force, halt, halt-force and halt-immediate have the effect of powering down the system, executing kexec, and halting the system respectively with similar semantics.
Then there's exit β causes the manager to exit following the normal shutdown procedure β and exit-force, which causes it to terminate without shutting down services. When exit or exit-force is used, by default the exit status of the main process of the unit (if this applies) is returned from the service manager. However, this may be overridden with FailureActionExitStatus/SuccessActionExitStatus, see below. π
And soft-reboot will trigger a userspace reboot operation. soft-reboot-force does that too, but does not go through the shutdown transaction beforehand.
Optional. Type enum. choice: 'exit', 'exit-force', 'halt', 'halt-force', 'halt-immediate', 'kexec', 'kexec-force', 'none', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'reboot', 'reboot-force', 'reboot-immediate', 'soft-reboot', 'soft-reboot-force'.
SuccessAction
Yes, it's the exact same energy as FailureAction, just on the success side of the timeline. π Configure the action to take when the unit stops and enters a failed state or inactive state. Takes one of none, reboot, reboot-force, reboot-immediate, poweroff, poweroff-force, poweroff-immediate, exit, exit-force, soft-reboot, soft-reboot-force, kexec, kexec-force, halt, halt-force and halt-immediate. In system mode, all options are allowed. In user mode, only none, exit, and exit-force are allowed. Both options default to none.
Run it back, same breakdown:
noneβ no action will be triggered.rebootβ causes a reboot following the normal shutdown procedure (i.e. equivalent tosystemctl reboot).reboot-forceβ causes a forced reboot which will terminate all processes forcibly but should cause no dirty file systems on reboot (i.e. equivalent tosystemctl reboot -f).reboot-immediateβ causes immediate execution of thereboot(2)system call, which might result in data loss (i.e. equivalent tosystemctl reboot -ff).
Similarly, poweroff, poweroff-force, poweroff-immediate, kexec, kexec-force, halt, halt-force and halt-immediate have the effect of powering down the system, executing kexec, and halting the system respectively with similar semantics. exit causes the manager to exit following the normal shutdown procedure, and exit-force causes it to terminate without shutting down services. When exit or exit-force is used, by default the exit status of the main process of the unit (if this applies) is returned from the service manager. However, this may be overridden with FailureActionExitStatus/SuccessActionExitStatus, see below. soft-reboot will trigger a userspace reboot operation. soft-reboot-force does that too, but does not go through the shutdown transaction beforehand. π¦
Optional. Type enum. choice: 'exit', 'exit-force', 'halt', 'halt-force', 'halt-immediate', 'kexec', 'kexec-force', 'none', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'reboot', 'reboot-force', 'reboot-immediate', 'soft-reboot', 'soft-reboot-force'.
StartLimitBurst
Rate limiting, but make it units. π¦ Configure unit start rate limiting. Units which are started more than burst times within an interval time span are not permitted to start any more. Use StartLimitIntervalSec to configure the checking interval and StartLimitBurst to configure how many starts per interval are allowed.
So, the deets: interval is a time span with the default unit of seconds, but other units may be specified, see systemd.time(7). The special value infinity can be used to limit the total number of start attempts, even if they happen at large time intervals. Defaults to DefaultStartLimitIntervalSec in manager configuration file, and may be set to 0 to disable any kind of rate limiting. burst is a number and defaults to DefaultStartLimitBurst in manager configuration file.
These configuration options are particularly useful in conjunction with the service setting Restart (see systemd.service(5)); however, they apply to all kinds of starts (including manual), not just those triggered by the Restart logic. π
Note that units which are configured for Restart, and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually or from a timer or socket at a later point, after the interval has passed. From that point on, the restart logic is activated again. systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that. Rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards the rate limit.
When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect. π
Oh and heads up: this setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time.
Optional. Type uniline.
StartLimitIntervalSec
Same setting, other half of the duo β the "how long is the window" part. β¨ Configure unit start rate limiting. Units which are started more than burst times within an interval time span are not permitted to start any more. Use StartLimitIntervalSec to configure the checking interval and StartLimitBurst to configure how many starts per interval are allowed.
interval is a time span with the default unit of seconds, but other units may be specified, see systemd.time(7). The special value infinity can be used to limit the total number of start attempts, even if they happen at large time intervals. Defaults to DefaultStartLimitIntervalSec in manager configuration file, and may be set to 0 to disable any kind of rate limiting. burst is a number and defaults to DefaultStartLimitBurst in manager configuration file.
These configuration options are particularly useful in conjunction with the service setting Restart (see systemd.service(5)); however, they apply to all kinds of starts (including manual), not just those triggered by the Restart logic. π₯
Note that units which are configured for Restart, and which reach the start limit are not attempted to be restarted anymore; however, they may still be restarted manually or from a timer or socket at a later point, after the interval has passed. From that point on, the restart logic is activated again. systemctl reset-failed will cause the restart rate counter for a service to be flushed, which is useful if the administrator wants to manually start a unit and the start limit interferes with that. Rate-limiting is enforced after any unit condition checks are executed, and hence unit activations with failing conditions do not count towards the rate limit.
When a unit is unloaded due to the garbage collection logic (see above) its rate limit counters are flushed out too. This means that configuring start rate limiting for a unit that is not referenced continuously has no effect.
And again, for the people in the back: this setting does not apply to slice, target, device, and scope units, since they are unit types whose activation may either never fail, or may succeed only a single time. π
Optional. Type uniline.
RebootArgument
Last one, and it's a lil garnish on your reboot. π Configure the optional argument for the reboot(2) system call if StartLimitAction or FailureAction is a reboot action. This works just like the optional argument to systemctl reboot command.
Optional. Type uniline.
π SEE ALSO π
cme
And that's a wrap on this whole page, bestie!! π«Άπ You made it to the end, main character behavior fr fr. This lil doc came from perl v5.40.1, dated 2026-03-22 β go be iconic with your unit configs, ily π β¨
π¦ where this page comes from
- ubuntu stonking: libconfig-model-systemd-perl 0.260.1-1 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms