66
www.obarun.org

66-scandir

This command handles the scandir for a given user. It is designed to be either root or a branch of the supervision tree.

Interface

	66-scandir [ -h help ] [ -v verbosity ] [ -b ] [ -l live ] [ -t rescan ] [ -L log_user ] [ -s skel ] [ -e environment ] [ -c | r | u ] owner
	

66-scandir create or start the scandir (a.k.a directory containing a collection of s6-supervise processes) for the given owner depending on the provided options. Note that owner can be any valid user on the system. However, the given user must have sufficient permissions to create the necessary directories at its location. That is /run/66 by default or the resulting path provided by the -l option. If owner is ommited, the user of the current process will be used instead.

Options

Scandir creation process

When creating the scandir with the ‑c option various files and directories will be created at the live directory for the given owner.

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 created with any normal user you will find the following in /run/66 (the directory created by default if -l is not passed and 1000 being the UID for the user):

If a scandir already exists for the given user it will prevent the creation when issuing 66‑scandir ‑c. If you want to create a different scandir for the same owner at the same live location you must delete it first with ‑r.

Environment configuration

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

Every daemon launched on the scandir should inherit the environment variables of the scandir. So if you want to have a specific key=value pair for every daemon, use this option.

Environment variable limits

The environment directory cannot exceed more than 100 files. Each file cannot contains more than 4095 bytes or more than 50 key=value pairs.

Scandir remove process

When using the ‑r option to delete the scandir of a given user 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 directory live 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 and the live root directory is not touched. As live should be created on a RAM filesystem the deletion happens on the next reboot.

Note: A running scandir can not be removed. You must stop it with e.g. 66-scanctl quit‑s quit first to be able to remove it.

Boot specification

The -b and -s options should be calls by 66-boot program. -b option will create .s6-svscan control files (see s6-svscan interface documentation) specifically for the stage1 a.k.a PID1 process. This scandir should be controlled by the safe halt, poweroff, reboot, shutdown wrapper provided with 66 tools suite. The 66-shutdownd daemon which control the shut down request will be created automatically at the correct location. Also, this specific tasks need the reads of the skel file init.conf which contain the live directory location where is the exact role of the -s option.

The live directory for a boot process requires writable directories, so in order to accommodate read-only root filesystems, there needs to be a tmpfs mounted before s6-svscan program is run.