S6-SYSTEMD-UNIT-CONVERSION(7)
๐
s6-systemd-unit-conv(7) โ Miscellaneous Information Manual ๐
ok so this is s6-systemd-unit-conv(7), and it lives in the Miscellaneous Information Manual, and it's literally all about how to convert systemd unit files to an s6 installation. buckle up bestie ๐
โจ NAME โจ
s6-systemd-unit-conversion โ how to convert systemd unit files to an s6 installation. that's it, that's the name, slay ๐
๐ธ DESCRIPTION ๐ธ
okay so the question of "how do i convert a whole set of services managed by systemd[1] into a set of services managed by s6" comes up constantly on our support channels. and lowkey, an automated conversion tool that parses a bunch of systemd.unit(5) files and spits out a bunch of directories (cf. s6-service-directory(7)) or s6-rc service definition directories (cf. s6-rc-compile(8)) would be genuinely so useful for people who wanna migrate to s6 but already have a whole existing base of services running under systemd. ๐ซถ
unfortunately ๐ญ automating that conversion is extremely difficult. the main reason is that systemd and s6 are architectured in very different ways: how they view a set of services, how they modelize a machine, what kind of solution they bring to a given problem, and the extent of what they're supposed to manage โ there are like, few similarities between how systemd and s6 operate. ngl, it's giving two entirely different species. as a consequence, the way systemd maps a set of services into unit files is not isomorphic to the way s6 does, so translating a setup between systemd and s6 requires intelligence. it is not possible to write an automated tool that converts a set of services accurately and idiomatically without doing a full, deep system analysis โ and writing such a tool would be a huge undertaking. ๐
fortunately tho (plot twist โจ), in practice, most unit files only use a small subset of all the theoretically supported directives. most services that run under systemd can be converted to run under s6 without too much trouble. so, depending on the exact nature of the set of services, it may be possible to write a reasonable converter that is limited in what it supports but does not require a full understanding of systemd (or even s6). ๐ฆ
this document targets people who think about writing a tool to automatically convert a set of unit files to a set of s6 services and are trying to assess its feasability and difficulty. we analyze all the directives that may appear in a unit file for their services, and rate the difficulty of translating the directive โ i.e. the amount of complexity that would need to go into the converter tool if that directive were to be supported. ๐
we rate difficulty on a scale from 0 to 10. bestie, here's the vibe check on the numbers:
0โ the directive is irrelevant to s6 and can just be ignored. bye ๐1โ there is a straightforward, one-for-one way of translating the systemd directive into s6 parlance. easy ate. ๐10โ the directive is so systemd-specific that it is impossible to express it on an s6 system and the unit file cannot be converted as is. rip ๐9โ it is theoretically possible to convert, given infinite time and manpower to write a tool that analyzes the systemd-managed system holistically and outputs an equivalent system managed by s6, but in practice nobody's ever going to write such a tool. not me writing that. never. ๐ญ
we only address directives that can appear in service units, which are the ones that can reasonably be expected to translate to s6 or s6-rc services. we do not address directives that can only appear in other kinds of unit files such as slices, timers, sockets, etc. ๐
๐ง Difficulty by directive ๐ง
use this section to answer the question: "I have this directive in my unit file, how hard would it be to write a converter tool that processes this file?" ๐ญ
๐ฅ Directives documented in systemd.unit(5) ๐ฅ
[Unit] section
Descriptionโ0.Documentationโ0.Wantsโ3. Dependencies between services are implemented vias6-rc[1]; in order to implementWantsthe converter needs to target s6-rc, which is a reasonable requirement for a complete set of services. However,Wantsexpresses weak dependencies, which are not supported by the current version of s6-rc, so the exact nature of the dependency needs to be checked by hand. ๐Requiresโ2. The converter needs to target s6-rc, butRequiresdependencies map well to the s6-rc dependency model. slay.Requisiteโ3. systemd supports a lot of weird types of dependencies that the current version of s6-rc does not (by design). ๐BindsToโ3. Same.PartOfโ3. Same.Upholdsโ0. In s6, services are upheld by the supervisor, not by other services. main character energy tbh ๐Conflictsโ5. There are no negative dependencies in the s6 world, and a converter tool would have to implement it on top of the existing system.Beforeโ2. systemd loves to have a zillion keywords to express slightly different kinds of dependencies, and only a small subset of all the possible combinations are useful. ๐Afterโ2.OnFailureโ5. Permanent failure is a very exceptional state in s6, there are no hooks to do something when permanent failure occurs; so a converter would need to add scripting around that.OnSuccessโ2. These are oneshot dependencies.PropagatesReloadToโ0. Under s6-rc you can either reload a single service or the whole dependency chain that starts at the service. Other configurations just make no sense. periodt.ReloadPropagatedFromโ0. Same.PropagatesStopToโ0. Same with stopping a single service or a dependency chain of services.StopPropagatedFromโ0. Same.JoinsNamespaceOfโ8. There are no native s6 tools to manage namespaces.RequiresMountsForโ4. Mounts are not handled in a special way in s6, the converter would have to know what service mounts what filesystem. ๐๏ธOnFailureJobModeโ6. This is what happens when you mix layers.IgnoreOnIsolateโ0.StopWhenUnneededโ0.RefuseManualStartโ4. Would need some scripting around. There's no reason to ever use that directive though.RefuseManualStopโ1.AllowIsolateโ0.DefaultDependenciesโ2.CollectModeโ0.FailureActionโ3. Anything involving permanent failure need to be scripted around, because s6 considers that it is an extreme state that requires administrator attention and will stop making automatic decisions. โ ๏ธSuccessActionโ3. That's a oneshot dependency, but systemd doesn't realize that.FailureActionExitStatusโ1.SuccessActionExitStatusโ1.JobTimeoutSecโ9. s6 has no concept of jobs.JobRunningTimeoutSecโ9. Same.JobTimeoutActionโ9. Same.JobTimeoutRebootArgumentโ9. Same.StartLimitIntervalSecโ3. s6 does not limit start rate. It can stop a service that has a high death rate: that's the configuration knob that makes sense. That directive can be converted to check death interval instead.StartLimitBurstโ3. Same.StartLimitActionโ3. Same.RebootArgumentโ5. Any "system mode" action such as a reboot has no place in an s6 set of services anyway; systemd obviously likes to mix unrelated layers. In the s6 world, the only place where a reboot should occur iss6-linux-init[2], and the related scripting inrc.initfiles. ๐ฅSourcePathโ0.Conditions and Assertsโ9. Most of these are tied to the global machine state and absolutely not local to a given set of services. And even for those that are not, what they do is change the whole service manager's behaviour depending on some external dynamic state such as the existence of a file in the filesystem โ and that is entirely contrary to the s6 philosophy of making services predictable and reproducible. big yikes. ๐
[Install] section
any directive under Install can be ignored, since it has no meaning on the run-time behaviour of the service. so the difficulty is 0. ๐
however, an automatic converter would need to analyze the whole installed service configuration, e.g. the links in /etc/systemd/system/multi-user.target.wants/, in order to understand the dependencies between services. systemd targets can typically be converted into s6-rc bundles. ๐ซถ
๐ Directives documented in systemd.service(5) ๐
[Service] section
Typeโ depending on its type, a systemd "service" can translate to wildly different things under s6. ๐simpleโ1.execโ1.forkingโ2. This type is strongly discouraged. ๐ฉoneshotโ1.dbusโ5. This type requires implementing dbus management programs for s6.notifyโ7. This type requires an implementation of a compatibility server forsd_notify(3), which is heavily tied to the monolithic systemd architecture and is difficult to support in a modular system such as s6. It is much easier to modify the services themselves so they use thes6-notifywhenup(7)s6 readiness notification mechanism instead ofsd_notify. ๐กidleโ0. This type is meaningless under s6 and should be treated likesimple.
ExitTypeโ again, it depends on the value.mainโ1.cgroupโ3. This requires implementing, or having access to, command-line cgroup tools.
RemainAfterExitโ0.GuessMainPidโ0. But don't useforkingif you can avoid it. ๐PIDFileโ 2. Same, no notes. ๐BusNameโ 5. Avoid typedbusif you possibly can, bestie. ๐ExecStartโ 2, but with caveats, and the caveats are doing a lot of heavy lifting here. This is the bread and butter of service definitions โ every one of your services is gonna have one of these, and the contents ofExecStarttypically go straight into a run script (for longruns) or an up file (for oneshots). โจ But since systemd hates simplicity with a burning passion, there are a whole bunch of transformations that have to happen to the command line before it's usable in a script, especially if the command has a special executable prefix. Implementing those has its own difficulty ratings, because of course it does:@โ 1.-โ 1.:โ 2.+โ 5.!โ 3.!!โ 3.
ExecStartPreโ 2. To get strict semantic equivalence with their systemd version,ExecStartPrelines have to be implemented as s6-rc oneshots, and the whole unit file has to be implemented as a bundle. That's the price of exactness. ๐ExecStartPostโ 2. Same. ๐ซถExecConditionโ 2.ExecReloadโ 0. Literally zero! A reloading command that doesn't involve restarting the service does not need the service manager as a third-party. systemd cannot help inserting itself where it does not belong โ it's giving main character syndrome. ๐ญExecStopโ 5. s6 only supports terminating services via signals, so if a service needs a specific command to stop it, the converter has to target an interface layer on top of s6 with a repository of stop commands; such a layer would likely need to be on top of s6-rc as well, and a lot of complexity would ensue. ๐ Fortunately, a huge majority of services support termination via signals, and it's often easy to avoid relying onExecStop.ExecStopPostโ 2. These are the down scripts of theExecStartPreoneshots. ๐RestartSecโ 2. s6 has no setting for that, because it aims for maximum uptime; but there are still ways to implement that bad idea. ๐TimeoutStartSecโ 1.TimeoutStopSecโ 1.TimeoutAbortSecโ 7. This would need a watchdog implementation, in the server implementation ofsd_notify(3). ๐ฎโ๐จTimeoutSecโ 1.TimeoutStartFailureModeโ 0 forterminateandkill, 7 forabort.TimeoutStopFailureModeโ 0 forterminateandkill, 7 forabort.RuntimeMaxSecโ 4. This is the exact opposite of what you need a process supervisor for, so s6 does not implement it. Run such a thing (a process, not a service) outside of any kind of supervision framework, bestie. ๐ธRuntimeRandomizedExtraSecโ 4. Same.WatchdogSecโ 7. Requires a watchdog implementation in the very specific systemd way. ๐Restartโ depends on the value, so buckle up:noโ 2, but why use a process supervisor in the first place? ๐คจon-successโ 2.on-failureโ 2.on-abnormalโ 2.on-watchdogโ 7. Again, this requires a watchdog implementation.on-abortโ 2.alwaysโ 1.
SuccessExitStatusโ 3. This can be easily scripted, but supporting all the systemd formats is annoying. ๐RestartPreventExitStatusโ 1. This is exactly whats6-permafailon(8) is for. Slay.RestartForceExitStatusโ 2.RootDirectoryStartOnlyโ 2.NonBlockingโ 5. This requires an emulation of systemd's socket activation. s6 provides the useful parts of it, like ans6-fdholder-daemon(8) process to hold file descriptors, but the systemd-specific API around socket activation,sd_listen_fds(3), still needs to be implemented. ๐ฅNotifyAccessโ 1 ifnone, 7 otherwise, because it needs an implementation ofsd_notify(3).Socketsโ 5. Requires an implementation of systemd's socket activation.FileDescriptorStoreMaxโ 7. Requires an implementation ofsd_notify(3); the fd store itself is native to s6, so that part's already iconic. ๐USBFunctionDescriptorsโ 9. This is low-level machine management, not service management. Not our department. ๐USBFunctionStringsโ 9. Same.OOMPolicyโ 9. Same.
โจ Directives documented in systemd.exec(5) โจ
๐ค๏ธ Paths
ExecSearchPathโ 1.WorkingDirectoryโ 2.RootDirectoryโ 1.RootImageโ 6. I am discovering these options in real time and shaking my head โ systemd still manages to baffle me with the amount of gratuitous ad-hoc that went into it. ๐ญ Still, this is regular low-level programming for Linux, so it's less difficult to implement than systemd-specific stuff โ that's why it only gets a 6.RootImageOptionsโ 6. Same.RootHashโ 9. Please. ๐RootHashSignatureโ 9.RootVerityโ 9.MountAPIVFSโ 6.ProtectProcโ 6.ProcSubsetโ 6.BindPathsโ 6.BindReadOnlyPathsโ 6.MountImagesโ 6.ExtensionImagesโ 6.ExtensionDirectoriesโ 6. It's a full low-level userspace implementation at this point. It's not very complex โ the 6 feels accurate โ but it's a whole lot of work. ๐ This is how systemd maintains its hegemony: not because it does incredible, awe-inspiring magic, but because it substitutes its monolithic self for a whole ecosystem, imposes its own API, and locks users in. People who want to smoothly transition away from systemd need to implement the whole shtick, which is obviously a huge undertaking โ as the author ofuselessd[4] can confirm. ๐ซ
๐งโ๐คโ๐ง User/group identity
Userโ 3. Looks very simple, but it is treacherous, becauseUseris a mash-up of two very different features: setting users statically (via numeric ID, which don't change meanings between two invocations) and setting users dynamically (via user name, which needs to be interpreted bygetpwnam(3) on every invocation of the service). s6 supports both, but since these are two different things, the way to do them in s6 is different โ statically setting theUIDandGIDvariables and callings6-applyuidgid -U, or callings6-setuidgid(8). ๐ This is the exact kind of small detail that makes writing an automatic converter more difficult than it should be: the systemd unit file syntax is rife with semantic pitfalls, and navigating your way across it requires very close attention. No cap.Groupโ 3. Same.DynamicUserโ 5. Of course this flag has an entirely different meaning from setting users statically or dynamically โ otherwise it would be too easy to understand. ๐ No, this flag is about allocating temporary new users, which is a prime example of overengineering.SupplementaryGroupsโ 1. Same.PAMNameโ 4. Requires PAM command-line utilities.
โก Capabilities
CapabilityBoundingSetโ 4. This requires command-line tools implementing capabilities.AmbientCapabilitiesโ 4. Same.
๐ Security
NoNewPrivilegesโ 4. Similar to capabilities, this requires a command-line tool controlling the Linux-specificprctl(2) system call.SecureBitsโ 4. Same.
๐ก๏ธ Mandatory access control
SELinuxContextโ 5. This requires command-line tools managing SELinux.AppArmorProfileโ 5. Same, with AppArmor.SmackProcessLabelโ 5. Same, with SMACK. systemd needs to know and understand all the Linux security modules in order to interact with them. s6 does not โ it expects a service's run script to perform all the needed process state changes and controls before executing into the daemon. ๐ That's the whole vibe.
๐งฌ Process properties
LimitCPUโ 1.LimitFSIZEโ 1.LimitDATAโ 1.LimitSTACKโ 1.LimitCOREโ 1.LimitRSSโ 1.LimitNOFILEโ 1.LimitASโ 1.LimitNPROCโ 1.LimitMEMLOCKโ 1.LimitLOCKSโ 2. This resource limit isn't natively supported bys6-softlimit 8, but it could appear in a future s6 version โ and it's easy to add in any case. โจLimitSIGPENDINGโ 2. Same.LimitMSGQUEUEโ 2. Same.LimitNICEโ 2. Same.LimitRTPRIOโ 2. Same.LimitRTTIMEโ 2. Same.UMaskโ 1.CoredumpFilterโ 4. Requires a command-line tool aroundprctl(2).KeyringModeโ 5. Requires interaction with PAM and an understanding of keyrings. Fortunately, practically nothing will need that. ๐OOMScoreAdjustโ 2.TimerSlackNSecโ 4. Requires a command-line tool aroundprctl(2).
๐ซถ Personality
Personalityโ difficulty 3. It's giving "needs a whole command-line tool wrappingpersonality(2)", so yeah, not a one-liner bestie.IgnoreSIGPIPEโ difficulty 2.
๐ธ Scheduling
Niceโ difficulty 1. Baby steps, we love to see it.CPUSchedulingPolicyโ difficulty 3. You're gonna need a command-line tool wrappingsched_setscheduler(2)for this one.CPUSchedulingPriorityโ difficulty 3. Same deal, same wrapper energy.CPUSchedulingResetOnForkโ difficulty 3. Also same.CPUAffinityโ difficulty 3. Requires a command-line tool aroundsched_setaffinity(2), no cap.NUMAPolicyโ difficulty 3. Needs a tool aroundset_mempolicy(2).NUMAMaskโ difficulty 3. Same.IOSchedulingClassโ difficulty 3. Needs a tool aroundioprio_set(2).IOSchedulingPriorityโ difficulty 3. Same, literally.
๐ Sandboxing
Okay so here's the tea, and it's honestly kind of iconic: systemd gracefully turns off the sandboxing options on systems that don't have the necessary functionality. Which means all of these options can be ignored (difficulty 0) and your services will still work. Slay.
But โ and this is the highkey important part โ if you actually want the sandboxing to do something, you have to pair s6 with command-line tools that perform the required process state changes, by interfacing with namespaces, cgroups, seccomp, or any other relevant feature of the Linux kernel. So for all of these directives, the difficulty is somewhere between 2 (if the tool already exists, cute, we love a shortcut) and 8 (if it requires writing a full container implementation from scratch ๐ญ). The devs are like, "the following numbers are only a rough guess", so take them as vibes, not gospel.
ProtectSystemโ difficulty 6.ProtectHomeโ difficulty 6.RuntimeDirectoryโ difficulty 1.StateDirectoryโ difficulty 1.CacheDirectoryโ difficulty 1.LogsDirectoryโ difficulty 1.ConfigurationDirectoryโ difficulty 1.RuntimeDirectoryModeโ difficulty 1.StateDirectoryModeโ difficulty 1.CacheDirectoryModeโ difficulty 1.LogsDirectoryModeโ difficulty 1.ConfigurationDirectoryModeโ difficulty 1.RuntimeDirectoryPreserveโ difficulty 3.TimeoutCleanSecโ difficulty 3.ReadWritePathsโ difficulty 5.ReadOnlyPathsโ difficulty 5.InaccessiblePathsโ difficulty 5.ExecPathsโ difficulty 5.NoExecPathsโ difficulty 5.TemporaryFileSystemโ difficulty 5.PrivateTmpโ difficulty 5.PrivateDevicesโ difficulty 5.PrivateNetworkโ difficulty 8.NetworkNamespacePathโ difficulty 8.PrivateIPCโ difficulty 5.IPCNamespacePathโ difficulty 5.PrivateUsersโ difficulty 5.ProtectHostnameโ difficulty 5.ProtectClockโ difficulty 7.ProtectKernelTunablesโ difficulty 7.ProtectKernelModulesโ difficulty 7.ProtectKernelLogsโ difficulty 7.ProtectControlGroupsโ difficulty 7.RestrictAddressFamiliesโ difficulty 7.RestrictFilesystemsโ difficulty 7.RestrictNamespacesโ difficulty 7.LockPersonalityโ difficulty 7.MemoryDenyWriteExecuteโ difficulty 7.RestrictRealtimeโ difficulty 7.RestrictSUIDSGIDโ difficulty 7.RemoveIPCโ difficulty 5.PrivateMountsโ difficulty 5.
๐ง System call filtering
SystemCallFilterโ difficulty 8.SystemCallErrorNumberโ difficulty 8.SystemCallArchitecturesโ difficulty 8.SystemCallLogโ difficulty 8.
๐ฆ Environment
Environmentโ difficulty 1.EnvironmentFileโ difficulty 1.PassEnvironmentโ difficulty 1.UnsetEnvironmentโ difficulty 1.
๐ Logging and standard input/output
StandardInputโ difficulty 1.StandardOutputโ difficulty 1, except forjournal, which cannot be supported (10). Yeah, that one's just not happening.StandardErrorโ Same.StandardInputTextโ difficulty 2.StandardInputDataโ difficulty 2.LogLevelMaxโ difficulty 3.LogExtraFieldsโ difficulty 10.LogRateLimitIntervalSecโ difficulty 10.LogRateLimitBurstโ difficulty 10.LogFilterPatternsโ difficulty 4.LogNamespaceโ difficulty 10.SyslogIdentifierโ difficulty 2.SyslogFacilityโ difficulty 2.SyslogLevelโ difficulty 2.SyslogLevelPrefixโ difficulty 4.TTYPathโ difficulty 1.TTYResetโ difficulty 3.TTYVHangupโ difficulty 3.TTYRowsโ difficulty 3.TTYColumnsโ difficulty 3.TTYDisallocateโ difficulty 3.
๐ฅ Credentials
Not gonna lie, this one's a whole mood. systemd implements its own credentials store mechanism, like, for no obvious benefit ๐. The whole credentials system needs to be reimplemented outside of systemd in order for credentials-related directives to be supported by s6. Consequently, all these directives are rated 6.
๐ System V compatibility
Bestie, the utmp directives can be made significantly easier to implement if the target system is using utmps[5], because the directives then become a single call to utmps-write[6] with the relevant options. Iconic behavior honestly. If utmps cannot be used, though, then the utmp calls need to be reimplemented. F in the chat.
UtmpIdentifierโ difficulty 4.UtmpModeโ difficulty 4.
๐ Directives documented in systemd.kill(5)
KillModeโ depends on the kill mode, bestie.control-groupandmixedare 3, because they require cgroup control commands (that can be implemented in shell โ yes, in shell, we love a low-effort queen).processis 1.noneis 2.KillSignalโ difficulty 1.RestartKillSignalโ difficulty 5.s6doesn't use a different signal for restarting, so implementing this requires an outer layer. (The page says, and I quote: this is overengineering.)SendSIGHUPโ difficulty 5. Same.SendSIGKILLโ difficulty 1.FinalKillSignalโ difficulty 5. (This one is absolute overengineering ๐.)WatchdogSignalโ difficulty 7. Only meaningful with an implementation ofsystemd's watchdog system.
โญ Directives documented in systemd.resource-control(5)
Okay so all of these directives relate to cgroups, which means implementing them requires having access to at least some cgroups commands (difficulty at least 3). Others are even more involved, requiring tight service integration with the system โ like, main-character-complex levels of involved.
๐จ Real talk: generally, seeing these directives in your unit files is a bad sign. Despite some of them only having 3 or 4 listed, we do not recommend implementing systemd.resource-control(5) without having a full holistic view of the system. Please don't come for us.
CPUAccountingโ difficulty 3.CPUWeightโ difficulty 4.StartupCPUWeightโ difficulty 9. Involves startup and shutdown.CPUQuotaโ difficulty 4.CPUQuotaPeriodSecโ difficulty 4.AllowedCPUsโ difficulty 3.StartupAllowedCPUsโ difficulty 9. Involves startup and shutdown.AllowedMemoryNodesโ difficulty 3.StartupAllowedMemoryNodesโ difficulty 9. Involves startup and shutdown.MemoryAccountingโ difficulty 3.MemoryMinโ difficulty 3.MemoryLowโ difficulty 3.MemoryHighโ difficulty 3.MemoryMaxโ difficulty 3.MemorySwapMaxโ difficulty 3.MemoryZSwapMaxโ difficulty 3.TasksAccountingโ difficulty 3.TasksMaxโ difficulty 3.IOAccountingโ difficulty 3.IOWeightโ difficulty 3.StartupIOWeightโ difficulty 9. Involves startup and shutdown.IODeviceWeightโ difficulty 5.IOReadBandwidthMaxโ difficulty 5.IOWriteBandwidthMaxโ difficulty 5.IOReadIOPSMaxโ difficulty 5.IOWriteIOPSMaxโ difficulty 5.IODeviceLatencyTargetSecโ difficulty 4.IPAccountingโ difficulty 7.IPAddressAllowโ difficulty 7.IPAddressDenyโ difficulty 7.IPIngressFilterPathโ difficulty 8.IPEgressFilterPathโ difficulty 8.BPFProgramโ difficulty 8.SocketBindAllowโ difficulty 6.SocketBindDenyโ difficulty 6.RestrictNetworkInterfacesโ difficulty 4.DeviceAllowโ difficulty 6.DevicePolicyโ difficulty 6.Sliceโ difficulty 9. Slices are asystemdconcept, and fully implementing them requires a holistic system analysis. Like, the whole system. Good luck babes.Delegateโ difficulty 4.DisableControllersโ difficulty 3.ManagedOOMSwapโ difficulty 8. Out-of-memory management is an entiresystemdsubsystem. Instead of implementing that, we recommend provisioning your machines correctly, and freeing up more resources for your applications by usings6. That's the tip, periodt.ManagedOOMMemoryPressureโ difficulty 8.ManagedOOMMemoryPressureLimitโ difficulty 8.ManagedOOMPreferenceโ difficulty 8.
๐ Directives rated by difficulty
Use this section to answer the question: โIf I were to write a converter tool from systemd to s6, what subset of the unit file syntax should I focus on first?โ
Take this classification with a grain of salt, bestie: for instance, it does not make sense to implement an easy directive if it's only used in the context of a larger subsystem that's much harder to implement โ typically, most cgroups-related resource control directives. So like, don't get cocky just 'cause something's a 1, iykyk.
โจ Difficulty: 0 โ directives that can be ignored
DescriptionDocumentationUpholdsPropagatesReloadToPropagatesStopToStopPropagatedFromIgnoreOnIsolateStopWhenUnneededAllowIsolateCollectModeSourcePathType=idleRemainAfterExitGuessMainPidExecReloadTimeoutStartFailureModeTimeoutStopFailureMode
๐ Difficulty: 1 โ direct functionality mapping
RefuseManualStopFailureActionExitStatusSuccessActionExitStatusType=simple|exec|oneshotExitType=mainTimeoutStartSecTimeoutStopSecTimeoutSecRestart=alwaysRestartPreventExitStatusNotifyAccess=noneExecSearchPathRootDirectorySupplementaryGroupsLimitCPULimitFSIZELimitDATALimitSTACKLimitCORELimitRSSLimitNOFILELimitASLimitNPROCLimitMEMLOCKUMaskNiceRuntimeDirectoryStateDirectoryCacheDirectoryLogsDirectoryConfigurationDirectoryRuntimeDirectoryModeStateDirectoryModeCacheDirectoryModeLogsDirectoryModeConfigurationDirectoryModeEnvironmentEnvironmentFilePassEnvironmentUnsetEnvironmentStandardInputStandardOutput(except journal)StandardError(except journal)TTYPathKillMode=processKillSignalSendSIGKILL
๐ Difficulty: 2 โ straightforward implementation
okay bestie, difficulty two is basically "yeah you got this, it's a chill afternoon project" ๐ no cap, these are the ones you can knock out without a whole character arc:
RequiresBeforeAfterOnSuccessDefaultDependenciesType=forkingPIDFileExecStart(omitting some prefixes)ExecStartPreExecStartPostExecConditionExecStopPostRestartSecRestartexcepton-watchdogRestartForceExitStatusRootDirectoryStartOnlyWorkingDirectoryLimitLOCKSLimitSIGPENDINGLimitMSGQUEUELimitNICELimitRTPRIOLimitRTTIMEOOMScoreAdjustIgnoreSIGPIPEStandardInputTextStandardInputDataSyslogIdentifierSyslogFacilitySyslogLevelKillMode=none
โจ Difficulty: 3 โ requires easy additional programming
so like, this tier is where you gotta actually write a lil bit of code, but it's giving "one weekend, two iced coffees, done" ๐ fr fr:
WantsRequisiteBindsToPartOfFailureActionSuccessActionStartLimitIntervalSecStartLimitBurstStartLimitActionExitType=cgroupSuccessExitStatusUserGroupPersonalityCPUSchedulingPolicyCPUSchedulingPriorityCPUSchedulingResetOnForkCPUAffinityNUMAPolicyNUMAMaskIOSchedulingClassIOSchedulingPriorityRuntimeDirectoryPreserveTimeoutCleanSecLoglevelMaxTTYResetTTYVHangupTTYRowsTTYColumnsTTYDisallocateKillMode=control-group|mixedCPUAccountingAllowedCPUsAllowedMemoryNodesMemoryAccountingMemoryMinMemoryLowMemoryHighMemoryMaxMemorySwapMaxMemoryZSwapMaxTasksAccountingTasksMaxIOAccountingIOWeightDisableControllers
๐ฆ Difficulty: 4 โ requires medium additional programming
medium programming, medium vibes, medium "omg why is this taking me three evenings" energy ๐ญ but you'll slay it:
RuntimeMaxSecRuntimeRandomizedExtraSecRequiresMountsForRefuseManualStartPAMNameCapabilityBoundingSetAmbientCapabilitiesNoNewPrivilegesSecureBitsCoredumpFilterTimerSlackNSecLogFilterPatternsSyslogLevelPrefixUtmpIdentifierUtmpModeCPUWeightCPUQuotaCPUQuotaPeriodSecIODeviceLatencyTargetSecRestrictNetworkInterfacesDelegate
๐ฅ Difficulty: 5 โ requires complex additional programming
okay now we're in complex territory, bestie โ this is the "clear your calendar and tell your friends you're busy" tier ๐:
ConflictsOnFailureRebootArgumentType=dbusBusNameExecStopNonBlockingSocketsDynamicUserSELinuxContextAppArmorProfileSmackProcessLabelKeyringModeReadWritePathsReadOnlyPathsInaccessiblePathsExecPathsNoExecPathsTemporaryFilesystemPrivateTmpPrivateDevicesPrivateIPCIPCNamespacePathPrivateUsersProtectHostnameRemoveIPCPrivateMountsRestartKillSignalSendSIGHUPFinalKillSignalIODeviceWeightIOReadBandwidthMaxIOWriteBandwidthMaxIOReadIOPSMaxIOWriteIOPSMax
๐ Difficulty: 6 โ requires a full independent implementation of a Linux subsystem and/or a part of the systemd architecture
yeah so at this point you're not "adding a feature", you're literally reimplementing a whole Linux subsystem and/or a chunk of the systemd architecture. it's giving icon behaviour but also it's giving suffering ๐ซถ:
OnFailureJobModeRootImageRootImageOptionsMountAPIVFSProtectProcProcSubsetBindPathsBindReadOnlyPathsMountImagesExtensionImagesExtensionDirectoriesProtectSystemProtectHomeAll credentials-related[7]directivesSocketBindAllowSocketBindDenyDeviceAllowDevicePolicy
๐ Difficulty: 7 โ requires a full independent implementation of a complex Linux subsystem and/or a significant part of the systemd architecture
"complex Linux subsystem" AND "a significant part of the systemd architecture"?? bestie that's not a task, that's a whole personality change ๐ good luck, genuinely:
Type=notifyTimeoutAbortSecTimeoutStartFailureMode=abortTimeoutStopFailureMode=abortWatchdogSecRestart=on-watchdogNotifyAccessFileDescriptorStoreMaxProtectClockProtectKernelTunablesProtectKernelModulesProtectKernelLogsProtectControlGroupsRestrictAddressFamiliesRestrictFilesystemsRestrictNamespacesLockPersonalityMemoryDenyWriteExecuteRestrictRealtimeRestrictSUIDSGIDWatchdogSignalIPAccountingIPAddressAllowIPAddressDeny
๐ง Difficulty: 8 โ requires a complete implementation of complex Linux-specific tooling
"complete implementation of complex Linux-specific tooling" โ no notes, that's just the whole sentence, and it ate ๐ฅ:
JoinsNamespaceOfPrivateNetworkNetworkNamespacePathSystemCallFilterSystemCallErrorNumberSystemCallArchitecturesSystemCallLogIPIngressFilterPathIPEgressFilterPathBPFProgramManagedOOMSwapManagedOOMMemoryPressureManagedOOMMemoryPressureLimitManagedOOMPreference
โญ Difficulty: 9 โ requires a full system analysis and remodelization
full system analysis AND remodelization?? that's not a port, that's a glow-up of your entire architecture. main character energy only ๐:
JobTimeoutSecJobRunningTimeoutSecJobTimeoutActionJobTimeoutRebootArgumentConditions and AssertsUSBFunctionDescriptorsUSBFunctionStringsOOMPolicyRootHashRootHashSignatureRootVerityStartupCPUWeightStartupAllowedCPUsStartupAllowedMemoryNodesStartupIOWeightSlice
๐ธ Difficulty: 10 โ implementing this basically means reimplementing systemd
and here it is. the final boss. the manpage itself says it: implementing these basically means reimplementing systemd ๐ like, the whole thing. literally just build systemd again at this point, bestie. iconic of the doc to warn us tbh ๐:
StandardOutput=journalStandardError=journalLogExtraFieldsLogRateLimitIntervalSecLogRateLimitBurstLogNamespace
๐ฆ SEE ALSO
go read these, bestie โ they're the whole friend group:
ioprio_set(2)personality(2)prctl(2)sched_setaffinity(2)sched_setscheduler(2)set_mempolicy(2)getpwnam(3)sd_listen_fds(3)sd_notify(3)systemd.exec(5)systemd.kill(5)systemd.resource-control(5)systemd.service(5)systemd.unit(5)s6-notifywhenup(7)s6-service-directory(7)s6-fdholder-daemon(8)s6-permafailon(8)s6-rc-compile(8)s6-setuidgid(8)
and the link drop, all seven of them, exactly as given ๐:
- [1]
https://systemd.io/ - [2]
https://skarnet.org/software/s6-rc/ - [3]
https://skarnet.org/software/s6-linux-init/ - [4]
https://web.archive.org/web/20150516113530/http://uselessd.darknedgy.net/ - [5]
https://skarnet.org/software/utmps/ - [6]
https://skarnet.org/software/utmps/utmps-write.html - [7]
https://man7.org/linux/man-pages/man5/systemd.exec.5.html#CREDENTIALS
This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/unit-conversion.html โ so if you want the original-original, that's where it lives ๐
๐ AUTHORS
- Laurent Bercot
- Alexis <flexibeat@gmail.com> (man page port)
okay that's the whole page, bestie โ you made it to the end ๐ฅณ this lil port shipped with Debian on November 11, 2023, and honestly? reading all ten difficulty tiers in one sitting is a flex. go drink some water, you've earned it ๐ ๐ซถโจ
๐ฆ where this page comes from
- nixpkgs unstable: s6 2.15.1.0
- nixpkgs unstable: s6-man-pages 2.14.0.1.4
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms