Commit 0e9b0d9c authored by Eric Vidal's avatar Eric Vidal 💬

Merge branch 'dev'

parents 7d7cf52f 416b891d
*.o
*.lo
*.a.*
.deps/
/66-all
/66-boot
/66-shutdown
/66-shutdownd
/66-hpr
/66-dbctl
/66-disable
/66-enable
/66-info
/66-init
/66-scandir
/66-scanctl
/66-start
/66-stop
/66-svctl
/66-tree
/66-env
/66-gnwenv
/66-parser
/66-which
/66-writenv
/66-getenv
/execl-envfile
/execl-subuidgid
/config.mak
/execl-cmdline
/66-envfile
/66-echo
/66-umountall
/src/include/66/config.h
/doc/man/*.[1-8]
Main author:
Eric Vidal <eric@obarun.org>
Contributors:
Danilo Spinella <danyspin97@protonmail.com>
......@@ -10,9 +10,8 @@ Build Instructions
- execline version 2.5.1.0 or later: http://skarnet.org/software/execline/
- s6 version 2.8.0.0 or later: http://skarnet.org/software/s6/
- s6-rc version 0.5.0.0 or later: http://skarnet.org/software/s6-rc/
- s6-portable-utils version 2.2.1.3 or later: http://skarnet.org/software/s6-portable-utils/
- oblibs version 0.0.1.0 or later: https://framagit.org/Obarun/oblibs/
- procps-ng version 3.3.15 or later: https://gitlab.com/procps-ng/procps
- scdoc version 1.9.4 or later for man pages: https://git.sr.ht/~sircmpwn/scdoc
This software will run on any operating system that implements
POSIX.1-2008, available at:
......@@ -140,6 +139,12 @@ make is necessary because targets are symbolic links, and the default make
behaviour is to check the pointed file's timestamp and not the symlink's
timestamp.
* Man Pages
---------
To generate man pages, be sure that scdoc (https://git.sr.ht/~sircmpwn/scdoc)
utility is installed. Run "make man" to generate the pages and "man install-man"
to install them under mandir.
* Absolute pathnames
------------------
......
......@@ -57,11 +57,15 @@ INSTALL := ./tools/install.sh
ALL_BINS := $(LIBEXEC_TARGETS) $(BIN_TARGETS)
ALL_LIBS := $(SHARED_LIBS) $(STATIC_LIBS) $(INTERNAL_LIBS)
ALL_INCLUDES := $(wildcard src/include/$(package)/*.h)
ALL_DATA := $(wildcard skel/*)
ALL_MAN := $(wildcard doc/man/*.[1-8].scd)
INSTALL_MAN := $(wildcard doc/man/*.[1-8])
all: $(ALL_LIBS) $(ALL_BINS) $(ALL_INCLUDES)
all: $(ALL_LIBS) $(ALL_BINS) $(ALL_INCLUDES) $(ALL_DATA)
clean:
@exec rm -f $(ALL_LIBS) $(ALL_BINS) $(wildcard src/*/*.o src/*/*.lo) $(EXTRA_TARGETS)
@exec rm -f $(ALL_LIBS) $(ALL_BINS) $(wildcard src/*/*.o src/*/*.lo) \
$(INSTALL_MAN) $(EXTRA_TARGETS)
distclean: clean
@exec rm -f config.mak src/include/$(package)/config.h
......@@ -82,13 +86,14 @@ ifneq ($(strip $(ALL_BINS)$(SHARED_LIBS)),)
exec $(STRIP) -R .note -R .comment -R .note.GNU-stack $(ALL_BINS) $(SHARED_LIBS)
endif
install: install-dynlib install-libexec install-bin install-lib install-include
install: install-dynlib install-libexec install-bin install-lib install-include install-data
install-dynlib: $(SHARED_LIBS:lib%.so.xyzzy=$(DESTDIR)$(dynlibdir)/lib%.so)
install-libexec: $(LIBEXEC_TARGETS:%=$(DESTDIR)$(libexecdir)/%)
install-bin: $(BIN_TARGETS:%=$(DESTDIR)$(bindir)/%)
install-lib: $(STATIC_LIBS:lib%.a.xyzzy=$(DESTDIR)$(libdir)/lib%.a)
install-include: $(ALL_INCLUDES:src/include/$(package)/%.h=$(DESTDIR)$(includedir)/$(package)/%.h)
install-data: $(ALL_DATA:skel/%=$(DESTDIR)$(sysconfdir)/%)
ifneq ($(exthome),)
$(DESTDIR)$(exthome): $(DESTDIR)$(home)
......@@ -108,6 +113,15 @@ $(DESTDIR)$(sproot)/library.so/lib%.so.$(version_M): $(DESTDIR)$(dynlibdir)/lib%
endif
$(DESTDIR)$(sysconfdir)/%: skel/%
exec $(INSTALL) -D -m 644 $< $@
grep -- ^$(@F) < package/modes | { read name mode owner && \
if [ x$$owner != x ] ; then chown -- $$owner $@ ; fi && \
chmod $$mode $@ ; } && \
exec sed -e "s/@BINDIR@/$(subst /,\/,$(bindir))/g" \
-e "s/@EXECLINE_SHEBANGPREFIX@/$(subst /,\/,$(shebangdir))/g" \
-e "s/@LIVEDIR@/$(subst /,\/,$(livedir))/g" $< > $@
$(DESTDIR)$(system_log)/% $(DESTDIR)$(service_packager)/% $(DESTDIR)$(service_sys)/% $(DESTDIR)$(service_sysconf)/% :
exec $(INSTALL) -D -m 0755 $< $@
......@@ -129,6 +143,9 @@ $(DESTDIR)$(libdir)/lib%.a: lib%.a.xyzzy
$(DESTDIR)$(includedir)/$(package)/%.h: src/include/$(package)/%.h
exec $(INSTALL) -D -m 644 $< $@
$(DESTDIR)$(mandir)/man1/%.1: man/%.1
exec $(INSTALL) -D -m 644 $< $@
%.o: %.c
exec $(REALCC) $(CPPFLAGS_ALL) $(CFLAGS_ALL) -c -o $@ $<
......@@ -145,6 +162,36 @@ lib%.a.xyzzy:
lib%.so.xyzzy:
exec $(REALCC) -o $@ $(CFLAGS_ALL) $(CFLAGS_SHARED) $(LDFLAGS_ALL) $(LDFLAGS_SHARED) -Wl,-soname,$(patsubst lib%.so.xyzzy,lib%.so.$(version_M),$@) $^ $(EXTRA_LIBS) $(LDLIBS)
.PHONY: it all clean distclean tgz strip install install-dynlib install-bin install-lib install-include
man: $(ALL_MAN:%.scd=%)
%: %.scd
sed -e 's,%%livedir%%,$(livedir),' \
-e 's,%%system_dir%%,$(system_dir),' \
-e 's,%%user_dir%%,$(user_dir),' \
-e 's,%%service_sysconf%%,$(service_sysconf),' \
-e 's,%%service_userconf%%,$(service_userconf),' \
-e 's,%%service_packager%%,$(service_packager),g' \
-e 's,%%user_log%%,$(user_log),' \
-e 's,%%service_sys%%,$(service_sys),' \
-e 's,%%system_log%%,$(system_log),' \
-e 's,%%sysconfdir%%,$(sysconfdir),' \
-e 's,%%service_user%%,$(service_user),' $@.scd | scdoc > $@
install-man:
for i in 1 5 8 ; do \
install -m755 -d $(DESTDIR)$(mandir)/man$$i; \
install -m644 man/*.$$i $(DESTDIR)$(mandir)/man$$i/ ; \
done
# %.1: %.1.scd
# scdoc < $@.scd > $@
# %.5: %.5.scd
# scdoc < $@.scd > $@
# %.8: %.8.scd
# scdoc < $@.scd > $@
.PHONY: it all clean distclean tgz strip install install-dynlib install-bin install-lib install-include man install-man
.DELETE_ON_ERROR:
......@@ -22,17 +22,20 @@ Fine tuning of the installation directories:
--libexecdir=DIR package-scoped executables [EPREFIX/libexec]
--libdir=DIR static library files [PREFIX/lib/$package]
--includedir=DIR C header files [PREFIX/include]
--sysconfdir=SYSDIR global configuration files [/etc/66]
--datarootdir=DATAROOTDIR read-only architecture-independent data root [PREFIX/share]
--mandir=DIR man documentation [$datarootdir/man]
--shebangdir=DIR absolute path for #! invocations [BINDIR]
--shebangdir=DIR absolute path for execline #\! invocations [BINDIR]
--livedir=DIR default live directory [/run/66]
--with-system-dir=DIR 66 tools root working directory[PREFIX/lib/66]
--with-packager-service=DIR packager service installation directory[DATAROOTDIR/66/service]
--with-sys-service=DIR sysadmin service directory[SYSDIR/sysadmin/service]
--with-sys-service-conf=DIR sysadmin service configuration directory[SYSDIR/conf]
--with-system-log=DIR root service log directory[/var/log/66]
--with-user-dir=DIR 66 tools user working directory[.66]
--with-system-log=DIR root service log directory[PREFIX/log/66]
--with-user-log=DIR user service log directory[.66/log]
--with-packager-service=DIR packager service installation directory[/etc/66/service]
--with-sys-service=DIR sysadmin service directory[/etc/66/sysadmin/service]
--with-user-service=DIR user service directory[.66/service]
--with-sys-service-conf=DIR sysadmin service configuration directory[/etc/66/conf]
--with-user-service-conf=DIR user service configuration directory[.66/conf]
Do not set an absolute path but a \$HOME relative path for --with-user-dir,
......@@ -155,16 +158,19 @@ libexecdir='$exec_prefix/libexec'
bindir='$exec_prefix/bin'
libdir='$prefix/lib/$package'
includedir='$prefix/include'
sysconfdir='/etc/66'
datarootdir='$prefix/share'
mandir='$datarootdir/man'
shebangdir='$bindir'
livedir='/run/66'
system_dir='$prefix/lib/66'
user_dir='.66'
system_log='/var/log/66'
user_log='.66/log'
service_packager='/etc/66/service'
service_sys='/etc/66/sysadmin/service'
service_packager='$datarootdir/66/service'
service_sys='$sysconfdir/sysadmin/service'
service_user='.66/service'
service_sysconf='/etc/66/conf'
service_sysconf='$sysconfdir/conf'
service_userconf='.66/conf'
sysdeps='$prefix/lib/skalibs/sysdeps'
manualsysdeps=false
......@@ -196,6 +202,9 @@ for arg ; do
--bindir=*) bindir=${arg#*=} ;;
--libdir=*) libdir=${arg#*=} ;;
--includedir=*) includedir=${arg#*=} ;;
--sysconfdir=*) sysconfdir=${arg#*=} ;;
--datarootdir=*) datarootdir=${arg#*=} ;;
--mandir=*) mandir=${arg#*=} ;;
--shebangdir=*) shebangisdefault=false ; shebangdir=${arg#*=} ;;
--livedir=*) livedir=${arg#*=} ;;
--with-system-dir=*) system_dir=${arg#*=} ;;
......@@ -243,6 +252,15 @@ if test -z "$prefix" ; then
if test "$includedir" = '$prefix/include' ; then
includedir=/usr/include
fi
if test "$datarootdir" = '$prefix/share'; then
datarootdir=/usr/share
fi
if test "$mandir" = '$datarootdir/man'; then
mandir=$datarootdir/man
fi
if test "$service_packager" = '$datarootdir/service' ; then
service_packager = '$datarootdir/66/service'
fi
if test "$system_dir" = '$prefix/lib/66' ; then
system_dir=/var/lib/66
fi
......@@ -251,6 +269,7 @@ if test -z "$prefix" ; then
fi
fi
# Expand installation directories
stripdir prefix
for i in exec_prefix dynlibdir libexecdir bindir libdir includedir shebangdir sproot sysdeps system_dir; do
......@@ -259,6 +278,20 @@ for i in exec_prefix dynlibdir libexecdir bindir libdir includedir shebangdir sp
stripdir $i
done
stripdir datarootdir
for i in service_packager mandir; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
stripdir sysconfdir
for i in service_sys service_user service_sysconf; do
eval tmp=\${$i}
eval $i=$tmp
stripdir $i
done
# Get usable temp filenames
i=0
set -C
......@@ -288,6 +321,9 @@ if $slashpackage ; then
libdir=${home}/library
libexecdir=$bindir
includedir=${home}/include
sysconfdir=${home}/etc/66
datarootdir=${home}/usr/share
service_packager=${home}/${datarootdir}/66/service
if $shebangisdefault ; then
shebangdir=${extbinprefix}
fi
......@@ -360,14 +396,11 @@ sysclock_lib=$(cat $sysdeps/sysclock.lib)
tainnow_lib=$(cat $sysdeps/tainnow.lib)
timer_lib=$(cat $sysdeps/timer.lib)
util_lib=$(cat $sysdeps/util.lib)
procps_lib=$($pkg_config --libs libprocps)
if $allpic ; then
tryflag CFLAGS_AUTO -fPIC
fi
tryflag CFLAGS_AUTO -std=c99
tryflag CFLAGS -fomit-frame-pointer
tryflag CFLAGS_AUTO -fno-exceptions
......@@ -408,7 +441,7 @@ fi
if test -z "$vpaths" ; then
while read dep ; do
base=$(basename $dep) ;
base=$(basename $dep)
vpaths="$vpaths /usr/lib/$base"
addlibspath="$addlibspath -L/usr/lib/$base"
done < package/deps-build
......@@ -431,7 +464,10 @@ libexecdir := $libexecdir
bindir := $bindir
libdir := $libdir
includedir := $includedir
shebangdir := $bindir
sysconfdir := $sysconfdir
shebangdir := $shebangdir
datarootdir := $datarootdir
mandir := $mandir
livedir := $livedir
system_dir := $system_dir
user_dir := $user_dir
......@@ -448,7 +484,6 @@ sproot := $sproot
version := $version
home := $home
exthome := $exthome
PROCPS_LIB := ${procps_lib}
SPAWN_LIB := ${spawn_lib}
SOCKET_LIB := ${socket_lib}
SYSCLOCK_LIB := ${sysclock_lib}
......@@ -499,7 +534,7 @@ echo "creating src/include/${package}/config.h..."
mkdir -p -m 0755 src/include/${package}
exec 3>&1 1> src/include/${package}/config.h
cat <<EOF
/* Copyright (c) 2018 Eric Vidal <eric@obarun.org>
/* Copyright (c) 2018-2019 Eric Vidal <eric@obarun.org>
All rights reserved.*/
/* ISC license. */
......@@ -512,6 +547,7 @@ All rights reserved.*/
#define ${package_macro_name}_VERSION "$version"
#define ${package_macro_name}_LIVE "$livedir/"
#define ${package_macro_name}_SYSTEM_DIR "$system_dir/"
#define ${package_macro_name}_DATA_SYSDIR "$sysconfdir/"
#define ${package_macro_name}_LOGGER_SYSDIR "$system_log/"
#define ${package_macro_name}_SERVICE_PACKDIR "$service_packager/"
#define ${package_macro_name}_SERVICE_SYSDIR "$service_sys/"
......
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="en" />
<title>The 66 Suite: 66-envfile</title>
<meta name="Description" content="Detailed documentation for the 66-envfile command which is part of the 66 software suite" />
<meta name="Keywords" content="66 command 66-envfile service supervision execute script execline environment importas" />
<!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
</head>
<body>
<p>
<a href="index.html">66</a><br />
<a href="//obarun.org/">www.obarun.org</a>
</p>
<h1>66-envfile</h1>
<p>
This command is a mix of <a href="https://skarnet.org/software/s6/s6-envdir.html"><tt>s6-envdir</tt></a> and <a href="https://skarnet.org/software/execline/importas.html"><tt>importas</tt></a> <em>program</em>.
It reads files containing variable assignments on the given directory, adds the variables to the environment, then executes a program.
</p>
<h2> Interface </h2>
<pre>
66-envfile [ -h ] [ -f <em>file</em> ] [ -l ] <em>dir</em> <em>prog</em>
</pre>
<p>
This tool expects to find a regular file(s) in <em>dir</em> containing one or multiple <tt>key=value</tt> pair. For earch files found, it will parse the file, import the <tt>key=value</tt> then execs <em>prog</em> with the modified environment.
</p>
<h2> Options </h2>
<ul>
<li> <tt>-h&nbsp;</tt>&nbsp;: prints this help. </li>
<li>
<tt>-f&nbsp;<em>file</em>&nbsp;</tt>&nbsp;: only parse <em>file</em> found in <em>dir</em>.
</li>
<li>
<tt>-l&nbsp;</tt>&nbsp;: loose. do nothing and executes <em>prog</em> directly if <em>dir</em> do not contain any regular file(s) or <em>dir</em> doesn't exist.
</li>
</ul>
<h2> File syntax </h2>
<p><em>file</em> is a text file containing lines of the form <tt>key = value</tt>. Whitespace is permitted before and after <em>key</em>, and before or after <em>value</em>,
Quoting is also possible. In this case, the quoting field is treated as one word.
</p>
<p>Empty lines, or lines containing only whitespace, are ignored. Lines beginning with <tt>#</tt> (possibly after some whitespace) are ignored (and typically used for comments). Comments are <strong>not</strong> possible at the end of lines:
<tt>key = value # comment</tt> is not a valid comment.
</p>
<p>Empty <em>value</em> is <strong>not</strong> permitted.</p>
<p>If <tt>key</tt> begin by a <tt>'!'</tt> character: <tt>!key=value</tt> the <tt>key</tt> will be removed from the environment after the substitution.</p>
<h2> Example of use </h2>
<pre>
#!/usr/bin/execlineb -P
fdmove -c 2 1
66-envfile -f ntpd /etc/66/conf/
foreground { mkdir -p -m 0755 ${RUNDIR} }
execl-cmdline -s { ntpd ${CMD_ARGS} }
</pre>
<tt>/etc/66/conf/ntpd</tt> file contain :
<pre>
!RUNDIR=/run/openntpd
!CMD_ARGS=-d -s
</pre>
<p>66-envfile reads <tt>/etc/66/conf/ntpd</tt> file, parses the file, import the variable <tt>RUNDIR</tt> and <tt>CMD_ARGS</tt>, replaces the <tt>${RUNDIR}</tt> and <tt>${CMD_ARGS}</tt> by the corresponding values, unexport the variable then execs the ntpd commandline.</p>
<p>The strict equivalent with s6-envdir and importas command will be:</p>
<pre>
#!/usr/bin/execlineb -P
fdmove -c 2 1
s6-envdir /etc/66/conf
importas -u RUNDIR RUNDIR
importas -u CMD_ARGS CMD_ARGS
foreground { mkdir -p -m 0755 ${RUNDIR} }
execl-cmdline -s { ntpd ${CMD_ARGS} }
</pre>
<p>where <tt>/etc/66/conf</tt> directory contains two named files <tt>RUNDIR</tt> and <tt>CMD_ARGS</tt> written with <tt>/run/openntpd</tt> and <tt>-d -s</tt> respectively.</p>
</body>
</html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="en" />
<title>The 66 Suite: 66-scandir</title>
<meta name="Description" content="Detailed documentation for the 66-scandir command which is part of the 66 software suite" />
<meta name="Keywords" content="66 command 66-scandir scandir supervision supervise svscan creation live" />
<!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
</head>
<body>
<p>
<a href="index.html">66</a><br />
<a href="//obarun.org/">www.obarun.org</a>
</p>
<h1>66-scandir</h1>
<p>
This command handles the scandir for a given user. It is designed to be either root or a branch of the <em>supervision tree</em>.
</p>
<h2> Interface </h2>
<pre>
66-scandir [ -h help ] [ -v <em>verbosity</em> ] [ -b boot ] [ -l <em>live</em> ] [ -t <em>rescan</em> ] [ -2 <em>stage2.tini</em> ] [ -3 <em>stage3</em> ] [ -e <em>environment</em> ] [ -c create ] [ -r remove ] [ -u up ] [ -s <em>signal</em> ] owner
</pre>
<p>
66-scandir will handle or create the scandir for the given <tt><em>owner</em></tt>
depending on the provided options. Note that <tt><em>owner</em></tt>
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 <tt>/run/66</tt> by default or the resulting path provided by the <tt>-l</tt> option.
If <tt><em>owner</em></tt> is ommited, the user of the current process will be used instead.
</p>
<h2> Options </h2>
<ul>
<li> <tt>-h&nbsp;</tt>&nbsp;: print the help. </li>
<li>
<tt>-v&nbsp;<em>verbosity</em>&nbsp;</tt>: increase/decrease
the verbosity of the command. <tt>1(Default)</tt>: Only print
error messages. <tt>2</tt>: Also print warning messages.
<tt>3</tt>: Also print debugging messages.
</li>
<li>
<tt>-b&nbsp;</tt>&nbsp;: create specific files for boot. Only root
user can use this option - see <a href="#svscanctld">.s6-svscan control directory"</a>.
</li>
<li>
<tt>-l&nbsp;<em>live</em></tt>&nbsp;: create the scandir at <em>live</em>. Default is
<tt>/run/66</tt>. The default can also be changed at compile-time by
passing the <tt>--livedir=<em>live</em></tt> option to <tt>./configure</tt>.
An absolute path is expected and should be under a writable filesystem
- likely a RAM filesystem.
</li>
<li>
<tt>-t&nbsp;<em>rescan</em></tt>&nbsp;: perform a scan every <tt><em>rescan</em></tt>
milliseconds. If <tt><em>rescan</em></tt> is set to <tty>0</tty> (the default), automatic scans are never performed after
the first one and s6-svscan will only detect new services by
issuing either <tt><em>66-scandir -s reload</em></tt>
or <tt><em><a href="https://skarnet.org/software/s6/s6-svscanctl.html">s6-svscanctl -a</a>
</em></tt>. It is <em>strongly</em> discouraged to set <tt><em>rescan</em></tt>
to a positive value under 500.
</li>
<li>
<tt>-2&nbsp;<em>stage2.tini</em></tt>&nbsp;: make the command to
execute a script with configurable handlers when the scandir receives a signal.
An absolute path is expected. This option is mandatory if passing <em>-b</em>
and cannot be used on its own. If not set, the default script at
<tt><em>/etc/66/stage2.tini</em></tt> will be called.
None of the 66 tools will provide such a script. It's the responsability
of the system administrator to provide it.
</li>
<li>
<tt>-3&nbsp;<em>stage3</em></tt>&nbsp;: script to execute when
the scandir is asked to be shut down. An absolute path is expected.
This option is mandatory if passing <em>-b</em> and cannot be
used on its own. If not set, the default script at
<tt><em>/etc/66/stage3</em></tt> will be called.
None of the 66 tools will provide such a script. It's the responsability
of the system administrator to provide it.
</li>
<li>
<tt>-e&nbsp;<em>environment</em></tt>&nbsp;: merge the current
environment variables of the scandir with variables found in the
<em>environment</em> directory. Any file in <tt><em>environment</em></tt>
not beginning with a dot and not containing the '=' character will
be read. An absolute path is expected.
</li>
<li>
<tt>-c&nbsp;</tt>&nbsp;: create the neccessary directories at <em>live</em>.
The command must be executed once with this option before being able to use <tt><em>-u</em></tt>.
</li>
<li>
<tt>-r&nbsp;</tt>: remove the scandir directory at <em>live</em>.
If it was already started with <tt><em>-u</em></tt> it must first
be stopped sending a signal with e.g. <tt><em>&#8209;s quit</em></tt> - see <a href="#signals">"Signals"</a>.
</li>
<li>
<tt>-u&nbsp;</tt>&nbsp;: start the scandir directory at <em>live</em>.
</li>
<li>
<tt>-s&nbsp;<em>signal</em></tt>&nbsp;: send a <em>signal</em> to the scandir directory.
The signal can be any valid <tt><a href="https://skarnet.org/software/s6/s6-svscanctl.html">s6&#8209;svscanctl</a></tt>
command or a predefined keyword - see <a href="#signals">"Signals</a>.
</li>
</ul>
<h2 id=signals> Signals </h2>
<p>The <em>-s</em> option sends a signal to the scandir and is built
around the <a href="https://skarnet.org/software/s6/s6-svscanctl.html">s6-svscanctl</a>.
It therefore acts in the same way. Any signal accepted by <tt><em>s6-svscanctl</em></tt>
can be passed just without the '-' character. If, for example, you
want to send a <tt><em>-t</em></tt> signal, you need to use:
<tt><em>66&#8209;scandir&nbsp;&#8209;s&nbsp;t</em></tt>. A series
of commands is also accepted in the same way: <tt><em>66&#8209;scandir&nbsp;&#8209;s&nbsp;st</em></tt>.
A few convenient keywords were added to avoid having to remember
basic and useful series of commands like:
<ul>
<li><tt>reload&nbsp;</tt>&nbsp;: equal to <tt><strong><em>&#8209;an</em></strong></tt></li>
<li><tt>interrupt&nbsp;</tt>&nbsp;: equal to <tt><strong><em>&#8209;i</em></strong></tt></li>
<li><tt>quit&nbsp;</tt>&nbsp;: equal to <tt><strong><em>&#8209;q</em></strong></tt></li>
<li><tt>halt&nbsp;</tt>&nbsp;: equal to <tt><strong><em>&#8209;0</em></strong></tt></li>
<li><tt>reboot&nbsp;</tt>&nbsp;: equal to <tt><strong><em>&#8209;6</em></strong></tt></li>
<li><tt>poweroff&nbsp;</tt>&nbsp;: equal to <tt><strong><em>&#8209;7</em></strong></tt></li>
</ul>
</p>
<h3>Signal usage examples</h3>
<pre> 66&#8209;scandir &#8209;s reload</pre>
<p>
Updates the process supervision tree
to exactly match the services listed in <tt>scandir</tt>.
</p>
<p>
This command is strictly equal to :
</p>
<pre> s6&#8209;svscanctl &#8209;an /service</pre>
<h2>Scandir creation process</h2>
<p>
When creating the <tt><em>scandir</em></tt> with the <tt>&#8209;c</tt>
option various files and directories will be created at the
<tt><em>live</em></tt> directory for the given <tt><em>owner</em></tt>.</p>
<p>
If created with the user <tt>root</tt>, you will find the following
in <tt>/run/66</tt> (the directory created by default if <tt>&#8209;l</tt>
is not passed and <tt>0</tt> being the corresponding UID for the root user):
</p>
<ul>
<li>
<tt>/run/66/scandir/0&nbsp;</tt>: stores all longrun proccesses
(a.k.a. daemons) started by the user <tt>root</tt>.
</li>
<li>
<tt>/run/66/tree/0&nbsp;</tt>: stores any s6&#8209;rc service
database started by the user <tt>root</tt>.
</li>
<li>
<tt>/run/66/log/0&nbsp;</tt>: stores the catch-all logger
when the scandir is created for a boot procedure with the
<tt>&#8209;b</tt> option.
</li>
</ul>
</p>
<p>
If created with any normal user you will find the following in