66

Software

obarun.org

66-scandir

Handles the scandir for a given user. Designed to be either root or a branch of the supervision tree.

Interface

    66-scandir [ -h ] [ -z ] [ -v verbosity ] [ -l live ] [ -b|B ] [ -c ] [ -L log_user ] [ -s skel ] [ -o owner ] create|remove

This program creates or remove the scandir (directory containing a collection of s6‑supervise processes) for the current owner of the proccess depending on the provided options.

Exit codes

Options

Scandir creation process

When creating the scandir various files and directories will be created at the live directory.

If created with the user root, you will find the following in /run/66 (the directory created by default if ‑l is not passed and 0 being the corresponding UID for the root user):

If the scandir was created with a regular user you will find the following in /run/66 (Default directories if ‑l is not passed and 1000 being the UID for the user):

The -B option create an extra directory at /run/66/scandir/<owner>/container containing a file named halt. See 66-boot for further information.

If a scandir already existed at the default location for the given user it will prevent its creation when calling 66‑scandir create. If you wanted to create a different scandir for the same owner at the same live location you must delete it first with 66-scandir remove.

Scandir removal process

The scandir must first be stopped sending a signal with 66‑scanctl stop or similar to be able to remove it.

Some directories of the scandir may not be removed if another user accesses them. In our previous example where we created a scandir for root with UID 0 and a regular user with the UID 1000 this would imply the following:

The live directory of the root user (in this example and by default /run/66) will not be removed because another user (the one from our example) can still use it. In fact 66‑scandir will only remove the subdirectories of the corresponding UID of the owner while the live root directory is not touched. If live was created on a RAM filesystem as suggested the deletion happens on the next reboot.

Boot specification

The -b, -B, -c and -s option are called by 66-boot. ‑b and -B will create .s6‑svscan control files (see s6‑svscan interface documentation) specifically for stage1 (PID1 process). This special scandir is controlled by the safe wrappers halt, poweroff, reboot, shutdown provided with 66 tools. The 66-shutdownd daemon which controls the shutdown request will be created automatically at the correct location. Further this specific task needs to read the skeleton file init.conf containing the live directory location which is the purpose of the ‑s option.

The live directory for the boot process requires writable directories and an executable filesystem. In order to accommodate for read‑only root filesystems there needs to be a tmpfs mounted before s6‑svscan can be run.

Environment configuration

You can modify environment variables when starting the scandir with the ‑e option. This option expects to find a valid absolute path to a directory containing one or more files where the format is the classic key=value pair. Each file found will be read and parsed.

Any service launched on the scandir will inherit the environment variables of the scandir. A specific global key=value pair inherited by all service can be set using this option.

Limits

The mentioned environment directory can not exceed more than 100 files. Each file can not contain more than 8095 bytes or more than 50 key=value pairs.