superd
superd is a service/daemon supervisor for users. It is not meant to replace system-level service supervisors (like openrc), and is somewhat analogous to systemd --user.
superd is configured primarily through individual text files that describe each service, what it requires, and what should be executed for it. It uses a configuration format very similar to systemd’s service specification. However, the supported format is not 100% compatible with systemd, the differences and more details are provided in superd.service(5).
Configuration directories have prioritization. Directory prioritization results in same-name config files effectively replacing previously defined config files in a lower priority directory. For example, if there is a /etc/superd/services/foo.service, and a ˜/.config/services/foo.service, then the latter file will be the one that superd uses.
The following directories are used by superd to provide service configuration or indicate auto-start status.
$XDG_DATA_DIRS/superd/services
Service configuration in this directory is not auto-started, but is searched when enabling a service with superctl. Config here is used at the lowest priority, meaning if no other file of the same name is found in any higher-priority directory, then the config here is used. This directory is intended for distro packages to install service configuration into, that users can manually enable with a tool like superctl.
/etc/superd/services
Service configuration in this directory is always auto-started for all users, unless the service is masked. The rationale behind this directory is that distros can choose to auto-start certain user services by providing configuration here, most likely by symlinking to the .service file from the service’s package that was installed in $XDG_DATA_DIRS/superd/services.
$XDG_CONFIG_HOME/superd/services
This is meant to contain user-specific configurations, either not found elsewhere on the system (i.e. in the above directories), or overriding one or more configuration from those directories by providing file(s) with the same name(s).
$XDG_CONFIG_HOME/superd/services/enabled
Configuration in this directory will be autostarted. Nominally the files here are symlinks to the actual files that are located elsewhere, since superctl can delete/manage files in this directory.
Symlinks in this directory can also be used to mask/disable services.
Services can be masked/disabled by creating a zero-length file of the same name in a higher priority directory than the directory where the original service config resides. The simplest way to do this is by symlinking to ‘/dev/null‘. For example, to disable a service located at ‘/etc/superd/services/foo.service‘, you might:
$ ln -s /dev/null ˜/.config/services/enabled/foo.service
To unmask/re-enable a service, remove the symlink/zero length file in the higher priority directory.
It is recommended to mask services by creating this symlink in $XDG_CONFIG_HOME/superd/services/enabled.
superctl will handle automatic symlink creation, etc when using the enable and disable commands.
superd logs to $XDG_STATE_HOME/superd.log. On most systems this is $HOME/.local/state/superd.log.
STDOUT and STDERR from each service is logged to $XDG_STATE_HOME/superd/logs/<name>.log, with simple log rotation on every start of the service. Each service’s output is logged to a separate file in this location.
superd.service(5) superctl(1)
Clayton Craft <[email protected]>