goetia
software
0x53.net

The runtime directory

The runtime directory is where the runtime information and configuration of all supervision trees is stored.

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.

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

Populating runtime directories

runtime directories are automatically populated from the configuration directory as well as s6-rc-init (see prepare-svscan).