The runtime directory is where the runtime information and configuration of all supervision trees is stored.
/run is mounted tmpfs at boot.
This can be changed using the --tmpfsdir=@tmpfsdir@
option to ./configure.
@tmpfsdir@/@sysrundir@.
@sysrundir@ is system
by default and can be changed using the
--sysrundir=@sysrundir@
switch to ./configure.
By default, the resulting path is thus:
/run/system.
@tmpfsdir@/@usrrundir@.
@usrrundir@ is user
by default and can be changed using the
--usrrundir=@usrrundir@
switch to ./configure.
By default, this results in
/run/user
A typical runtime directory looks as follows:
@tmpfsdir@
├── @sysrundir@
│ ├── s6-rc -> s6-rc:s6-rc-init:CoHrfy
│ ├── s6-rc:s6-rc-init:CoHrfy
│ ├── service
│ │ ├── .s6-svscan
│ │ ├── goetia-shutdown
│ │ ├── s6-svscan-log
│ │ └── servicedir1a
│ └── log
│ └── uncaught-logs
└── @usrrundir@
├── @USER1@
│ ├── @USERTREE@
│ │ ├── s6-rc -> s6-rc:s6-rc-init:LVy5Wh
│ │ ├── s6-rc:s6-rc-init:LVy5Wh
│ │ └── service
│ │ ├── .s6-svscan
│ │ ├── goetia-shutdown
│ │ └── s6-svscan-log
│ └── @USERTREE@
│ ├── s6-rc -> s6-rc:s6-rc-init:nCTKjF
│ ├── s6-rc:s6-rc-init:nCTKjF
│ └── service
│ ├── .s6-svscan
│ ├── goetia-shutdown
│ └── s6-svscan-log
└── @USER2@
The directories serve the following purpose:
@tmpfsdir@/@sysrundir@
The run-image subdirectory of the
system configuration directory
is copied here during init.
service:
@confdir@/system/run-image/service
will be copied here by init, recognized by
s6-svscan
and interpreted by
s6-supervise
independently of s6-rc.
Of course, service directories can be copied or symlinked manually
to this directory.
s6-rc and s6-rc:s6-rc-init:CoHrfy:
s6-rc:s6-rc-init:CoHrfy
is a directory used by s6-rc for state tracking,
s6-rc is a symlink to it.
log:
@tmpfsdir@/@usrrundir@
Contains user owned supervision trees grouped by user.
the @tmpfsdir@/@usrrundir@/@USER1@ directory
is owned by @USER1@ and can be used for anyting
by this user.
The
user-tmpfs
program exists to prepare those directories easily.
The run-image subdirectory of the
user configuration directory
is copied to
@tmpfsdir@/@usrrundir@/${USER}
during
user-init.
For each @USER1@, @USER2@, ... ,
there is an arbitrary amount of @USERTREE@,
@USERTREE@, ... subdirectories.
These represent the multiple user supervision trees
each user may have.
Each of these has the same structure and purpose as
@tmpfsdir@/@sysrundir@/, but for the
user supervision tree.
The @tmpfsdir@/@usrrundir@/${USER} directory
is intended to be used as an properly permissioned user specific tmpfs.
A secure alternative to /tmp without the sticky bit.
A practical example would be creating a directory like
@tmpfsdir@/@usrrundir@/${USER}/runtime
as the XDG_RUNTIME_DIR and
setting the environment variable
XDG_RUNTIME_DIR=@rundir@/user/${USER}/runtime.
runtime directories are automatically populated from the configuration directory as well as s6-rc-init (see prepare-svscan).