Config...ceUnit(3pm)

πŸŽ€ Config::Model::models::Systemd::Section::ServiceUnit πŸŽ€

okay bestie, we're reading Config::Model::models::Systemd::Section::ServiceUnit(3pm) from User Contributed Perl Documentation and it is a lot, so hydrate and let's go πŸ’–


πŸ’– NAME πŸ’–

Config::Model::models::Systemd::Section::ServiceUnit β€” the configuration class Systemd::Section::ServiceUnit. that's the whole name. iconic.


✨ DESCRIPTION ✨

Configuration classes used by Config::Model. periodt.


πŸ¦‹ Elements πŸ¦‹

these are the pieces you get to configure. buckle up, there's a bunch 🫢


🌸 Description 🌸

a brief, meaningful, human-readable text that identifies the unit. it may be used by systemd (and suitable UIs) as a user-visible label for the unit, so this string should identify the unit rather than just describe it β€” yes, despite the name, bestie, the name is lying to you 😭. also this string should not just repeat the unit name.

good examples: "Apache HTTP Server" or "Postfix Mail Server" β€” those ate. bad examples: "high-performance lightweight HTTP server" (too generic, it's giving nothing) or "Apache" (meaningless for people who do not know the Apache HTTP server project, and it duplicates the unit name πŸ™ˆ).

systemd may use this string as a noun in status messages, specifically "Starting Description...", "Started Description.", "Reached target Description.", and "Failed to start Description." β€” so lowkey it should be capitalized, should not be a full sentence, should not be a phrase with a verb conjugated in the present continuous, and should not 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. the only accepted URI types are "http://", "https://", "file:", "info:", and "man:". for more info about the syntax of these URIs, see uri(7) πŸ“–.

list them in order of relevance, most relevant first, no cap. it's 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 ✨.

this option may be specified more than once, in which case the specified list of URIs is merged. but!! if the empty string is assigned to this option, the list is reset and all prior assignments will have no effect 😭 (it's giving "undo everything").

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. so 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. bestie they're just going, together, at the same time 😭

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). it's giving codependent, ngl.

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. so like, softer vibes = sturdier system, noted πŸ“.

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.

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. the drama.

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 🫣.

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 πŸ”. 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 the 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.

(yeah bestie, this one's uniline, not a list. we noticed. πŸ’…)


πŸ’€ 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 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 πŸ¦‹.


that's where part 1 wraps, bestie β€” more is coming, don't go anywhere πŸ’–

When two units with an ordering dependency between them get shut down, everything runs in reverse of the start-up order. So if a unit is set up with After on another unit, the first one stops before the second one β€” assuming both are being shut down. 🫑

And if you've got two units with any ordering dependency between them, and one gets shut down while the other starts up? The shutdown goes first. Periodt. Doesn't matter whether the dependency is After or Before, and it doesn't matter which of the two is being shut down β€” as long as one is stopping and one is starting, the stop is ordered before the start in all cases. ✨

If two units have no ordering dependencies between them at all, they just do their thing simultaneously β€” no ordering happens, it's giving parallel chaos, it's fine. πŸ’…

When exactly a unit has "finished starting up" depends on the unit type. Biggest one: for service units, start-up counts as complete for the purposes of Before/After once 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 when we're talking shutdown). πŸ‘‘

Also!! These settings are independent of β€” and orthogonal to β€” the requirement dependencies you configure 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 configured with those options. πŸ’–

And one more: Before dependencies on device units have no effect and are not supported. Devices show up as the result 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. πŸŽ€

They configure ordering dependencies between units. If foo.service has 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 the inverse of Before β€” Before makes sure the configured unit starts before the listed unit begins starting up, while After makes sure the opposite: the listed unit is fully started up before the configured unit starts. πŸ”„

When two units with an ordering dependency between them get shut down, the inverse of the start-up order applies. 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 this is specified 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 which support the PrivateNetwork, NetworkNamespacePath, PrivateIPC, IPCNamespacePath, and PrivateTmp directives (see systemd.exec(5) for details). If a unit that has this setting set is started, its processes will see the same /tmp/, /var/tmp/, IPC namespace and network namespace as one listed unit that is started. If multiple listed units are already started and these do not share their namespace, then it is not defined which namespace is joined β€” so, like, don't rely on that one. πŸ™ˆ 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 they 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 it 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 $unit and 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

Bestie, this one takes a boolean. If it's "true", the unit is allowed to be used with the systemctl isolate command. If not, systemctl isolate will simply be refused. πŸ’…

Real talk though: probably keep this disabled unless you're dealing with target units that are meant to act like runlevels in SysV init systems β€” it's a precaution, so you don't end up in an unusable system state 😭.

Defaults to "false".

Optional. Type boolean.


DefaultDependencies

Takes a boolean. If "yes" β€” and yes, that's the default β€” a few default dependencies get implicitly created for the unit ✨. Which dependencies actually get created depends on the unit type. Like, for service units, these dependencies make sure the service is only started after basic system initialization is done, and that it gets properly terminated on system shutdown. See the respective man pages for the details πŸ‘‘.

Generally, ONLY services involved with early boot or late shutdown should ever set this to "no". It is highly recommended to leave it enabled for the majority of common units, fr fr 🫢. And important: if you set it to "no", that does not disable all implicit dependencies β€” just the non-essential ones.

Optional. Type boolean.


SurviveFinalKillSignal

Takes a boolean, 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 let a program set argv[0][0] = '@' as described at systemd and Storage Daemons for the Root File System (https://systemd.io/ROOT_STORAGE_DAEMONS) β€” which, btw, continues to be supported anyway 🌸.

Optional. Type boolean.

upstream_default value:

no

CollectMode

This one tweaks the "garbage collection" algorithm for the unit 🧹✨. Takes one of "inactive" or "inactive-or-failed".

  • If set to "inactive", the unit will be unloaded if it's in the "inactive" state and isn't referenced by clients, jobs, or other units β€” but it will not be unloaded if it's in the "failed" state πŸ™ˆ. In "failed" mode, failed units are not unloaded until the user invokes systemctl reset-failed on them to reset the "failed" state, or an equivalent command.
  • If set to "inactive-or-failed", that behaviour changes: the unit gets unloaded even if it's in a "failed" state, so you don't have to explicitly reset the "failed" state πŸ’….
Heads up bestie: if this mode is used, unit results (like exit codes, exit signals, consumed resources, …) get flushed out immediately after the unit completed β€” except for whatever's stored in the logging subsystem 😭.

Defaults to "inactive".

Optional. Type enum. choice: 'inactive', 'inactive-or-failed'.


FailureActionExitStatus

Controls the exit status that gets propagated back to an invoking container manager (in the case of a system service) or service manager (in the case of a user manager) when "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 that applies) is what gets propagated πŸ‘‘.

Takes a value in the range 0…255, or the empty string to request default behaviour.

Optional. Type uniline.


SuccessActionExitStatus

Same energy as above, iconic πŸ’–. Controls the exit status propagated back to an invoking container manager (system service case) or service manager (user manager case) when "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, and it starts running when the job is queued ⏳. ("JobRunningTimeoutSec" β€” more on that in a sec β€” is the one that starts running when the queued job is actually started.)

If either limit is reached, the job will be cancelled β€” but the unit 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 that's waiting for the unit state to change 🫢.

Optional. Type uniline.


JobRunningTimeoutSec

Okay so same text as above, bestie, because they're a package deal πŸ’…. "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 the 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

Yep, same text again bestie, they're twins πŸ‘―. "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" gets hit πŸ”₯. Takes the same values as the "FailureAction"/"SuccessAction" settings.

If "none" is set, hitting the rate limit triggers 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 that this unit has been generated from πŸŽ€. This is primarily useful for implementing generator tools that convert configuration from an external configuration file format into native unit files ✨.

This functionality should not be used in normal units, bestie. Just don't πŸ™ˆ.

Optional. Type uniline.


ConditionArchitecture

Checks 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:

(That's genuinely where the list lives, bestie β€” no cap, the values go right there πŸ’–.)

Optional. Type list of uniline.


ConditionVirtualization

Check whether the system is executed in a virtualized environment β€” and optionally test whether it's a specific implementation 🌈.

Takes either a boolean value to check if it's 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're 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 ✨. That latter one gets 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

okay so bestie, this one checks whether your kernel version β€” the thing uname -r spits out β€” matches a certain expression. Or, if you put an exclamation mark in front of it, that it does NOT match. 🫢

The argument has to be a list of (potentially quoted) expressions. Every expression kicks off with one of these:

  • = or != β€” string comparisons
  • <, <=, ==, <>, >=, > β€” version comparisons
  • $=, !$= β€” a shell-style glob match ✨

If you don't give an operator at all, $= is implied. so chill.

⚠️ okay real talk: using the kernel version string to figure out which features a kernel supports is unreliable, because of the extremely widespread practice of backporting drivers, features and fixes from newer upstream kernels into the older versions distributions ship. So this check is inherently unportable and should not be used for units that might be used on different distributions. no cap. πŸ’€

Optional. Type list of uniline.


ConditionVersion

ConditionVersion checks whether a software version matches an expression, or β€” if it's prefixed with the exclamation mark β€” that it does not match. πŸ¦‹

The first argument is the software whose version has to be checked. Right now the supported ones are kernel, systemd and glibc. If you omit this argument, kernel is implied.

The second argument must be a list of (potentially quoted) expressions. Each expression starts with one of:

  • = or != β€” string comparisons
  • <, <=, ==, <>, >=, > β€” version comparisons
  • $=, !$= β€” a shell-style glob match

And again, no operator means $= is implied. πŸ’…

Optional. Type list of uniline.


ConditionCredential

This one checks whether a credential with the specified name was passed into the service manager. See System and Service Credentials at <https://systemd.io/CREDENTIALS> for the whole tea. πŸ“

  • Using it in services for the system service manager? Then you can conditionalize services based on system credentials that were passed in.
  • Using it in services for the per-user service manager? Then you can conditionalize services based on the credentials passed into the unit@.service service instance that belongs to the user.

The argument must be a valid credential name. bestie don't make up names. πŸ™ˆ

Optional. Type list of uniline.


ConditionEnvironment

ConditionEnvironment checks whether a specific environment variable is set β€” or, if prefixed with the exclamation mark, whether it's unset β€” in the service manager's environment block. 🌈

Your argument can be:

  • a single word β€” checks if the variable with that name is defined in the environment block, or
  • an assignment (name=value) β€” checks if the variable with that exact value is defined.
πŸ‘€ heads up! It's the environment block of the service manager itself that gets checked β€” i.e. not any variables defined with Environment or EnvironmentFile like we talked about above.

This is super useful when the service manager is running inside a containerized environment, or as the per-user service manager β€” that way you can check for variables passed in by the enclosing container manager or by PAM. πŸŽ€

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. ! = flip the vibe. πŸ’…

Optional. Type list of uniline.


ConditionCapability

Check whether the given capability exists in the capability bounding set of the service manager. lowkey important: this does not check whether the capability is actually available in the permitted or effective sets β€” see capabilities(7) for those details. πŸ‘‘

Pass a capability name like CAP_MKNOD, possibly prefixed 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 time the unit activates. Takes a boolean argument. ⚑

  • Set to true β†’ the condition holds only if at least one AC connector of the system is connected to a power source, or if no AC connectors are known at all.
  • Set to false β†’ the condition holds only if there's 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 condition conditionalizes units on whether the specified directory requires an update β€” which happens when /usr/'s modification time is newer than the stamp file .updated inside that specified directory. Useful for implementing offline updates of the vendor operating system resources in /usr/ that require updating /etc/ or /var/ on the next boot.

πŸ’… pro move: units making use of this condition should order themselves before systemd-update-done.service(8), so they're sure to run before the stamp file's modification time gets reset (which is the signal that the update is done).

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, taking precedence over any file modification time checks. And if that kernel command line option is used, systemd-update-done.service will not have immediate effect on any following ConditionNeedsUpdate checks β€” not until the system is rebooted without the kernel command line option specified anymore. 😭

⚠️ also note: for this scheme to actually work, the timestamp of /usr/ should be explicitly updated after its contents are modified. The kernel only automatically updates the modification timestamp on a directory when immediate children of that directory are modified. Modifying nested files will not automatically result in the mtime of /usr/ being updated. ngl that trips everyone up.
πŸ’œ another one: if the update method includes a call to run 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 the installation or upgrade, so package contents are immediately usable. ConditionNeedsUpdate should be used with other update mechanisms where such an immediate update does not happen.

Optional. Type list of enum.


ConditionFirstBoot

Takes a boolean argument. This condition lets you conditionalize units on whether the system is booting up for the first time. 🧚

Roughly speaking that means /etc/ was unpopulated when the system started booting (for the details, see "First Boot Semantics" in machine-id(5)). First Boot is considered finished β€” and this condition will evaluate as false β€” after the manager has finished the startup phase.

You can use this to populate /etc/ on the first boot after a factory reset, or when a brand-new system instance boots up for the first time. 🌸

☝️ note that the service manager itself performs 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. Any 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, these units will be re-run during the next system startup. 🫢

If the systemd.condition_first_boot= option is specified on the kernel command line (it takes 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 is prefixed with an exclamation mark (!), the test is negated β€” meaning the unit only starts if the path does not exist. sneaky but iconic.

Optional. Type list of uniline.


ConditionPathExistsGlob

ConditionPathExistsGlob is similar to ConditionPathExists, except 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 similar to ConditionPathExists, but it verifies that a certain path exists and is a directory. πŸ“

Optional. Type list of uniline.


ConditionPathIsSymbolicLink is similar to ConditionPathExists, but it verifies that a certain path exists and is a symbolic link. πŸ”—

Optional. Type list of uniline.


ConditionPathIsMountPoint

ConditionPathIsMountPoint is similar to ConditionPathExists, but it verifies that a certain path exists and is a mount point. πŸ—‚οΈ

Optional. Type list of uniline.


ConditionPathIsReadWrite

ConditionPathIsReadWrite is similar to 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 similar to ConditionPathExists, but it verifies that the underlying file system's backing block device is encrypted using dm-crypt/LUKS. πŸ”

🚨 important caveats, 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. It is not detected whether the file system backing the loopback block device is encrypted.

Optional. Type list of uniline.


ConditionPathIsSocket

ConditionPathIsSocket is similar to ConditionPathExists, but it verifies that a certain path exists and is a socket. 🧦

Optional. Type list of uniline.


ConditionDirectoryNotEmpty

ConditionDirectoryNotEmpty is similar to ConditionPathExists, but it verifies that a certain path exists and is a non-empty directory. πŸ“‚βœ¨

Optional. Type list of uniline.


ConditionFileNotEmpty

ConditionFileNotEmpty is similar to 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 similar to 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. πŸ‘‘

This condition checks whether the service manager is running as the given user. The special value @system can be used to check if the user id is within the system user range.

🌈 ngl 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. πŸ’€

Optional. Type list of uniline.

🌸 ConditionGroup

Bestie, this one is basically ConditionUser's sibling πŸ’… β€” except instead of checking a user, it verifies that the service manager's real group or effective group (or literally any of its auxiliary groups) matches the group or GID you named. Heads up though: this setting does not support the special value @system. Optional. Type: list of uniline.


πŸŽ€ ConditionControlGroupController

Okay so this one is doing a vibe check on your cgroup controllers β€” it asks whether the controllers you name (like cpu) are actually available for use on the system, and whether it's the legacy v1 cgroup hierarchy or the modern v2 one hanging around. ✨

You can pass multiple controllers by separating them with a space; in that case the condition only passes if all the listed controllers are available. Controllers unknown to systemd just get ignored. The valid controllers are cpu, io, memory, and pids. And ngl, even if a controller exists in the kernel, it might still be unavailable if it was disabled on the kernel command line with cgroup_disable=controller. 😭

Alternatively, you can specify two special strings β€” v1 and v2 β€” without any controller names. v2 passes if the unified v2 cgroup hierarchy is in use, and v1 passes if the legacy v1 hierarchy or the hybrid hierarchy is in use. Lowkey important warning though: legacy and hybrid hierarchies have been deprecated. See systemd(1) for more info. Optional. Type: list of uniline.


🧚 ConditionMemory

This one verifies that the amount of system memory you specified is available to the current system. It takes a memory size in bytes as its argument, and you can optionally prefix it with a comparison operator: <, <=, = (or ==), != (or <>), >=, >. πŸ‘‘

On bare-metal systems it compares the amount of physical memory in the system against your specified size, following whatever comparison operator you gave it. But in containers it compares the amount of memory assigned to the container instead. Optional. Type: list of uniline.


πŸ¦‹ ConditionCPUs

Verifies 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 for the service manager itself against the number you gave, sticking to the comparison operator. 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 and not the ones that are physically available. Optional. Type: list of uniline.


πŸ”₯ ConditionCPUFeature

Checks whether a given CPU feature is available via the CPUID instruction. Fr fr, this one only does anything on i386 and x86-64 processors β€” on any other processor it just assumes the CPU doesn't support the given feature. It checks the leaves 1, 7, 0x80000001, and 0x80000007.

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

Verifies that a specific key=value pair is set in the host's os-release(5).

Other than exact string matching (with = and !=), relative comparisons are supported for versioned parameters (e.g. VERSION_ID; using <, <=, ==, <>, >=, >), and shell-style wildcard comparisons (*, ?, []) are supported with the $= (match) and !$= (non-match). πŸŽ€

Oh and btw β€” 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 (memory, CPU or IO) pressure is below or equal to a threshold.

This setting takes a threshold value as its argument. You can specify it 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 happens. Alternatively, the average timespan can be specified using / as a separator, like this: 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, some gets checked. For more deets, see the documentation on PSI (Pressure Stall Information) at 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 you don't specify the slice unit, the overall system pressure is measured instead of a particular cgroup's. Optional. Type: list of uniline.


πŸ“ ConditionCPUPressure

Verify that the overall system (memory, CPU or IO) pressure is below or equal to a threshold.

This setting takes a threshold value as its argument. You can specify it 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 happens. Alternatively, the average timespan can be specified using / as a separator, like this: 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, some gets checked. For more deets, see the documentation on PSI (Pressure Stall Information) at 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 you don't specify the slice unit, the overall system pressure is measured instead of a particular cgroup's. Optional. Type: list of uniline.


🌸 ConditionIOPressure

Verify that the overall system (memory, CPU or IO) pressure is below or equal to a threshold.

This setting takes a threshold value as its argument. You can specify it 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 happens. Alternatively, the average timespan can be specified using / as a separator, like this: 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, some gets checked. For more deets, see the documentation on PSI (Pressure Stall Information) at 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 you don't specify the slice unit, the overall system pressure is measured instead of a particular cgroup's. Optional. Type: list of uniline.


πŸŽ€ ConditionKernelModuleLoaded

Tests whether the kernel module you named has been loaded and is already fully initialized. Optional. Type: list of uniline. ✨


πŸ‘‘ AssertArchitecture

Okay so listen β€” these Assert* settings are like the condition settings described above (ConditionArchitecture, ConditionVirtualization, …), and they add assertion checks to the start-up of the unit. But here's the plot twist, bestie: unlike the condition settings, any assertion setting that is not met results in failure of the start job (which means it 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 at all) β€” 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.


πŸ’– AssertVirtualization

Just like the condition settings above (ConditionArchitecture, ConditionVirtualization, …), these settings add assertion checks to the start-up of the unit. But unlike the condition settings, any assertion setting that is not met results in failure of the start job (which means it 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.


🌈 AssertHost

Similar to ConditionArchitecture, ConditionVirtualization, … and all those condition settings above β€” these add assertion checks to the unit's start-up. However, unlike the condition settings, any assertion that isn't met results in failure of the start job (logged loudly, no cap πŸ“’).

Note that hitting a configured assertion does not make the unit enter the failed state (or actually cause any state change of the unit at all) β€” it only affects the job queued for it. Use assertion expressions for units that cannot operate when specific requirements are not met, and when it's something the administrator or user should look into. Optional. Type: uniline.


πŸ”₯ AssertKernelCommandLine

Similar to ConditionArchitecture, ConditionVirtualization, … and the condition settings described above, these settings add assertion checks to the start-up of the unit. But unlike the condition settings, 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 (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. πŸ’…


⭐ AssertKernelVersion

Like ConditionArchitecture, ConditionVirtualization, … and those condition settings we talked about, these add assertion checks to the unit's start-up. Unlike the condition settings though, any assertion setting that is not met results in failure of the start job (logged loudly, periodt πŸ“’).

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. πŸ¦‹

πŸ’– AssertVersion πŸ’–

Okay bestie, so these next ones are the assertion girlies πŸ’… and they're basically cousins of the ConditionArchitecture, ConditionVirtualization, … condition settings we just talked about β€” same flavor of setting, they add assertion checks to the start-up of the unit. But here's the plot twist that changes EVERYTHING: conditions are chill, assertions are not. The moment an assertion setting isn't met, the start job straight-up fails, and it gets logged loudly πŸ“’ (everyone's gonna know, no hiding it).

Now breathe, because it's not as dramatic as it sounds: hitting a configured assertion does not yeet the unit into the "failed" state, and honestly it doesn't cause any state change of the unit at all. It affects only the job queued for it. Periodt. ✨

So vibe check: 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.


πŸŽ€ AssertCredential πŸŽ€

Same energy as ConditionArchitecture, ConditionVirtualization, … and all those condition settings from above β€” these settings add assertion checks to the start-up of the unit. But unlike the conditions settings (which are giving "eh, skip it" ✨), any assertion setting that is not met results in failure of the start job, which means this is logged loudly πŸ”₯.

And again, lowkey important: 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, like, 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.


🌸 AssertEnvironment 🌸

Okay so, similar to the ConditionArchitecture, ConditionVirtualization, … condition settings described above, these settings add assertion checks to the start-up of the unit. But unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly, bestie, 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.


πŸ¦‹ AssertSecurity πŸ¦‹

Just like the ConditionArchitecture, ConditionVirtualization, … conditions we described above, these settings add assertion checks to the start-up of the unit. Unlike the conditions though, any assertion setting that is not met = failure of the start job, and it's logged loudly, no cap πŸ—£οΈ.

And the cute little 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.


πŸ’œ AssertCapability πŸ’œ

Similar vibe to the ConditionArchitecture, ConditionVirtualization, … condition settings described above β€” these settings add assertion checks to the start-up of the unit. But unlike the conditions settings, any assertion setting that is not met results in failure of the start job (and yes, that means it 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.


⚑ AssertACPower ⚑

So, similar to the ConditionArchitecture, ConditionVirtualization, … condition settings described above, these settings add assertion checks to the start-up of the unit. However β€” and this is the main character moment β€” unlike the conditions settings, any assertion setting that is not met results in failure of the start job (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.


πŸ”₯ AssertNeedsUpdate πŸ”₯

Similar to the ConditionArchitecture, ConditionVirtualization, … condition settings described above, these settings add assertion checks to the start-up of the unit. Unlike the conditions settings, though, any assertion setting that is not met results in failure of the start job (which means this is logged loudly, so like… everyone will hear about it πŸ’€).

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.


⭐ AssertFirstBoot ⭐

Just like the ConditionArchitecture, ConditionVirtualization, … condition settings from above, these settings add assertion checks to the start-up of the unit. But unlike the conditions settings, any assertion setting that is not met results in failure of the start job β€” which means this is logged loudly, bestie, it's giving alarm bells 🚨.

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.


πŸ“ AssertPathExists πŸ“

Similar to 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 is logged loudly β€” no quiet failing here, she's loud 🎀).

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.


🌈 AssertPathExistsGlob 🌈

Similar to the ConditionArchitecture, ConditionVirtualization, … condition settings described above, these settings add assertion checks to the start-up of the unit. But unlike the conditions settings (which are soft-launch energy), any assertion setting that is not met results in failure of the start job (which means this is logged loudly, periodt πŸ’…).

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.


🧚 AssertPathIsDirectory 🧚

Okay so, similar to the ConditionArchitecture, ConditionVirtualization, … condition settings described above, these settings add assertion checks to the start-up of the unit. However, once again, unlike the conditions settings, any assertion setting that is not met results in failure of the start job β€” and this one is logged loudly, so bestie, prepare yourself πŸ“’.

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.


Similar to the ConditionArchitecture, ConditionVirtualization, … condition settings described above, these settings add assertion checks to the start-up of the unit. Unlike the conditions settings, any assertion setting that is not met results in failure of the start job (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.


πŸ‘‘ AssertPathIsMountPoint πŸ‘‘

Similar to 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 is logged loudly, iconic behaviour honestly 😀✨.

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.


πŸ’– AssertPathIsReadWrite πŸ’–

Similar to the ConditionArchitecture, ConditionVirtualization, … condition settings described above, these settings add assertion checks to the start-up of the unit. But unlike the conditions settings, any assertion setting that is not met results in failure of the start job (which means this is logged loudly, and yes, it's a whole thing πŸ™ˆ).

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.


πŸ¦‹ AssertPathIsEncrypted πŸ¦‹

Alright, similar to 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 is logged loudly β€” she does not do subtlety πŸŽ€).

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.

πŸ¦‹ AssertPathIsSocket

So remember how ConditionArchitecture, ConditionVirtualization, … and all those condition settings up there work? Yeah bestie, this is their louder cousin. These are assertion checks that get bolted onto the start-up of the unit, and the key difference is: if a condition isn't met, the unit just quietly doesn't start. If an assertion isn't met, the start job fails, and it fails loudly β€” it gets logged like the whole group chat is watching. πŸ“£

That said, here's the part people always get wrong: tripping an assertion does not shove the unit into the failed state. It doesn't change the unit's state at all. It only messes with the job that was queued for it. That's it. That's the whole vibe.

Reach for assertions when your unit genuinely cannot operate without some specific requirement being met, and when that's something an administrator or user should actually look into. It's giving "this is your problem now" energy.

Optional. Type is uniline. πŸ’…


πŸŽ€ AssertDirectoryNotEmpty

Same deal as AssertPathIsSocket, same family as the ConditionArchitecture, ConditionVirtualization, … conditions above β€” these add assertion checks to the unit's start-up. Conditions failing = silence. An assertion failing = the start job fails, and yes, it's logged loudly. πŸ“’

And no, hitting an assertion does not put the unit into failed, and honestly it doesn't change the unit's state in any way at all β€” it only affects the job queued for it. Say it with me: job only, not the unit. 🫢

Use it for units that can't operate when specific requirements aren't met, and when that situation is something an admin or user should be looking into.

Optional. Type is uniline.


πŸ“ AssertFileNotEmpty

Yep, another assertion setting, sibling to all the ConditionArchitecture, ConditionVirtualization, … conditions we already covered above. They add assertion checks to the start-up of the unit, and unlike conditions, an unmet assertion means the start job fails β€” loudly, in the logs, no chill. πŸ”₯

Important, don't skip this: hitting a configured assertion does not make the unit enter the failed state, and it doesn't cause any state change on the unit either. It only affects the job queued for it. Periodt. πŸ’…

Reach for assertion expressions when the unit cannot operate unless specific requirements are met, and when the administrator or user should be the one looking into it.

Optional. Type is uniline.


🌈 AssertFileIsExecutable

Ok so, same energy as the ConditionArchitecture, ConditionVirtualization, … condition settings described above, but assertion-flavored: these add assertion checks to the start-up of the unit. And the twist versus conditions? An assertion that isn't met makes the start job fail, which means it's logged loudly. Everybody's gonna know. 😭

But β€” crucial β€” 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. Not the unit. The job. 🫢

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 is uniline.


🧚 AssertUser

Similar to the ConditionArchitecture, ConditionVirtualization, … condition settings described above β€” yes, bestie, I'm telling you again β€” these add assertion checks to the start-up of the unit. Unlike conditions, an unmet assertion fails the start job, loudly, in the logs. Not subtle. πŸ“£

And the disclaimer that never changes: 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 at all). It affects only the job queued for it. πŸ’…

Use assertion expressions when a unit cannot operate unless specific requirements are met, and when this is something the administrator or user should look into.

Optional. Type is uniline.


⭐ AssertGroup

These settings (same crew as ConditionArchitecture, ConditionVirtualization, … up above) add assertion checks to the start-up of the unit. Unlike the condition settings, an assertion that isn't met results in failure of the start job β€” which means it gets logged loudly. It's giving main character tantrum, ngl. 😭

Note that hitting a configured assertion does not cause the unit to enter the failed state β€” in fact it doesn't result in any state change of the unit. It only affects the job queued for it. That distinction is the whole point, don't sleep on 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 is uniline.


πŸ’œ AssertControlGroupController

So, just like the ConditionArchitecture, ConditionVirtualization, … condition settings described above, these settings add assertion checks to the start-up of the unit. And unlike conditions, any assertion that isn't met fails the start job β€” logged loudly, all caps in the logs basically. πŸ”₯

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. That's the vibe, that's the rule. πŸ’…

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 is uniline.


🌸 AssertMemory

Same package as the ConditionArchitecture, ConditionVirtualization, … condition settings above, but assertion-coded. These add assertion checks to the start-up of the unit. The difference from conditions: an unmet assertion = the start job fails, and it's logged loudly so everyone hears about it. πŸ“’

And hitting a configured assertion does not cause the unit to enter the failed state β€” it doesn't cause any state change of the unit, full stop. 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 is uniline.


πŸ¦‹ AssertCPUs

Similar to the ConditionArchitecture, ConditionVirtualization, … condition settings described above β€” these add assertion checks to the start-up of the unit. Unlike conditions, an assertion that isn't met results in failure of the start job, which means it is logged loudly. No soft launches here. πŸ’€

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. Write that on your mirror. πŸͺž

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 is uniline.


πŸŽ€ AssertCPUFeature

Like the ConditionArchitecture, ConditionVirtualization, … condition settings described above, these settings add assertion checks to the start-up of the unit. But unlike conditions, any assertion that isn't met makes the start job fail β€” and yes, that's logged loudly. πŸ””

Also: hitting a configured assertion does not cause the unit to enter the failed state, and it doesn't cause any state change of the unit either. It affects only the job queued for it. So the unit itself stays exactly where it was, emotionally and physically. πŸ’…

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 is uniline.


🌈 AssertOSRelease

Same family as ConditionArchitecture, ConditionVirtualization, … above β€” these are assertion checks added to the start-up of the unit. Unlike the condition settings, an assertion that isn't met results in failure of the start job, which means it's logged loudly. Very "everyone will see this" energy. 😭

And a reminder that never expires: 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 is uniline.


πŸ“ AssertMemoryPressure

Just like the ConditionArchitecture, ConditionVirtualization, … condition settings described above, these settings add assertion checks to the start-up of the unit. Unlike conditions though, any assertion that isn't met = failed start job, logged loudly. It's giving public callout. πŸ“£

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. Periodt. πŸ’…

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 is uniline.


⭐ AssertCPUPressure

Similar to the ConditionArchitecture, ConditionVirtualization, … condition settings described above, these settings add assertion checks to the start-up of the unit. Unlike the conditions, an unmet assertion results in failure of the start job β€” logged loudly, bestie. πŸ“’

And here's the thing: 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 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 is uniline.


πŸ’œ AssertIOPressure

Exact same setup as the ConditionArchitecture, ConditionVirtualization, … condition settings described above β€” these add assertion checks to the start-up of the unit. But unlike conditions, any assertion that isn't met makes the start job fail, which means it gets logged loudly. πŸ”Š

Also, 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. That's the whole tea. β˜•

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 is uniline.


🌸 AssertKernelModuleLoaded

Last but never least: similar to the ConditionArchitecture, ConditionVirtualization, … condition settings described above, these settings add assertion checks to the start-up of the unit. Unlike the condition settings, an assertion that isn't met results in failure of the start job β€” logged loudly, no filter. 😭

And hitting a configured assertion does not cause the unit to enter the failed state, and it doesn't cause any state change of the unit either. It affects only the job queued for it. Reread that if you have to, it matters. 🫢

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 is uniline.


πŸ’€ StartLimitInterval

Deprecated. Don't get attached, it's on the way out.

Optional. Type is uniline. πŸ’…

πŸ’€ OnFailureIsolate

Deprecated. Optional. Type uniline.

bestie this one is deprecated, meaning it's giving "we're not doing this anymore" energy. Don't start using it. It's still here so old configs don't explode, but that's it πŸ’…

🚨 FailureAction

Okay so this one is the drama queen of the config β€” it decides what happens when your unit stops and lands in a failed state or an inactive state. The way it just picks up the whole machine and does something about it? iconic.

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.

Mode check fr: 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 breakdown, no cap:

  • If none is set, no action will be triggered. Chill.
  • reboot causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl 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 to systemctl reboot -f).
  • reboot-immediate causes immediate execution of the reboot(2) system call, which might result in data loss (i.e. equivalent to systemctl 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 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'.

Note: FailureAction is migrated with $service and with:

  • $service => "- - Service FailureAction"

🌟 SuccessAction

Same vibe, different trigger πŸ’– This one configures 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.

Mode check again: in system mode, all options are allowed. In user mode, only none, exit, and exit-force are allowed. Both options default to none.

  • If none is set, no action will be triggered.
  • reboot causes a reboot following the normal shutdown procedure (i.e. equivalent to systemctl 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 to systemctl reboot -f).
  • reboot-immediate causes immediate execution of the reboot(2) system call, which might result in data loss (i.e. equivalent to systemctl 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 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'.

Note: SuccessAction is migrated with $service and with:

  • $service => "- - Service SuccessAction"

🚦 StartLimitBurst

Okay bestie, this is the rate limiter β€” the "girl you need to calm down" setting for units that keep trying to start.

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. πŸ€·β€β™€οΈ

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.

Note: StartLimitBurst is migrated with $service and with:

  • $service => "- - Service StartLimitBurst"

⏱️ StartLimitIntervalSec

The sibling of the one above, same energy, same whole paragraph, because they're a package deal fr fr.

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.

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.

Note: StartLimitIntervalSec is migrated with "$unit || $service" and with:

  • $service => "- - Service StartLimitInterval"
  • $unit => "- StartLimitInterval"

πŸ”„ RebootArgument

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.

Note: RebootArgument is migrated with $service and with:

  • $service => "- - Service RebootArgument"

🌈 SEE ALSO

  • cme

And that's a wrap on this whole page, bestie!! πŸŽ€ You made it to the end, which is genuinely an achievement because this thing is LONG. periodt. πŸ’…

Source vibes: this came from the User Contributed Perl Documentation for Config...ceUnit(3pm), built for perl v5.40.1, dated 2026-03-22. Go forth and configure responsibly, mwah 🫢✨

πŸ“¦ where this page comes from