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>
This diff is collapsed.
<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-svctl</title>
<meta name="Description" content="Detailed documentation for the 66-svctl command which is part of the 66 software suite" />
<meta name="Keywords" content="66 command 66-svctl service supervision supervise handles service" />
<!-- <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-svctl</h1>
<p>
This command is used to control an already supervised <em>service</em> at <em>live</em> defined in a <em>tree</em>.
</p>
<h2> Interface </h2>
<pre>
66-svctl [ -h ] [ -v <em>verbosity</em> ] [ -l <em>live</em> ] [ -t <em>tree</em> ] [ -T <em>timeout</em> ] [ -n <em>death</em> ] [ -u| U | d | D | r | R | K | X ] <em>service(s)</em>
</pre>
<p>
This tool expects to find an already supervised <em>service</em> at <em>live</em> defined in the given <em>tree</em> and an already running <em>scandir</em>.
<br>(!) This tool only deals with <em>'classic'</em> services&mdash;see <a href="66-dbctl.html"><tt>66-dbctl</tt></a> for other types of services.
</p>
<p>Multiple <em>services</em> can be handled by seperating their names with a space. <tt>66-svctl</tt> gathers each of these services in a list called <em>selection</em>.</p>
<h2> Options </h2>
<ul>
<li> <tt>-h&nbsp;</tt>&nbsp;: prints this help. </li>
<li>
<tt>-v&nbsp;<em>verbosity</em>&nbsp;</tt>&nbsp;: increases/decreases
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>-l&nbsp;<em>live</em>&nbsp;</tt>&nbsp;: changes the supervision directory of <em>service</em> to <em>live</em>. By default this will be <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 existing absolute path is expected and
should be within a writable filesystem - likely a RAM filesystem&mdash;see <tt><a href="66-scandir.html">66-scandir</a></tt>.
</li>
<li>
<tt>-t&nbsp;<em>tree</em>&nbsp;</tt>&nbsp;: handles the <em>service</em> from
the given <em>tree</em>. This option is mandatory
except if a tree was marked as 'current'&mdash;see <a href="66-tree.html"><tt>66-tree</tt></a>.
</li>
<li>
<tt>-T&nbsp;<em>timeout</em>&nbsp;</tt></tt>&nbsp;: specifies a general timeout (in milliseconds)
after which <tt>66-svctl</tt> will exit 111 with an error message if the <em>selection</em> still hasn't reached the desired state for each <em>service</em>;
defaults to 0 (blocks indefinitely).
</li>
<li>
<tt>-n&nbsp;<em>death</em>&nbsp;</tt>&nbsp;: specifies the maximum number of service death events that the supervisor will keep track of.
If the service dies more than this number of times, <tt>66-svctl</tt> will exit 111 with an error message if the <em>services</em> still hasn't reached the desired state.
This option has <strong>no effect</strong> if a <em>maxdeath</em> was defined for the given service at parsing time&mdash;see <tt><a href="66-frontend.html">frontend</a></tt>.
If this option is not specified and no <em>max-death-tally</em> file exists the maximum allowed deaths will default to 3.
</li>
<li>
<tt>-u|U&nbsp;</tt>&nbsp;: sends an <em>up</em> signal to the <em>service</em>. Uppercase <tt>U</tt> asks for readiness notification and searches for a <em>notification-fd</em>
file&mdash;see <tt><a href="https://skarnet.org/software/s6/notifywhenup.html">service startup notifications</a></tt> and <tt><a href="66-frontend.html">frontend</a></tt>.
If this file doesn't exist <tt>66-svctl</tt> will automatically change to lowercase <tt>u</tt> and warn the user about the change.
</li>
<li>
<tt>-d|D&nbsp;</tt>&nbsp;: sends a <em>down</em> signal to the <em>service</em>. Uppercase <tt>D</tt> asks for readiness notification and searches for a <em>notification-fd</em>
file&mdash;see <tt><a href="https://skarnet.org/software/s6/notifywhenup.html">service startup notifications</a></tt> and <tt><a href="66-frontend.html">frontend</a></tt>.
If this file doesn't exist <tt>66-svctl</tt> will automatically change to lowercase <tt>d</tt> and warn the user about the change.
</li>
<li>
<tt>-r|R&nbsp;</tt>&nbsp;: sends a <em>reload</em> signal to the <em>service</em>. By default, the signal is a SIGTERM; this can be configured via the <tt>@down-signal</tt> field in the <tt><a href="66-frontend.html">frontend</a></tt> service file. Uppercase <tt>R</tt> asks for readiness notification and searches for a <em>notification-fd</em>
file&mdash;see <tt><a href="https://skarnet.org/software/s6/notifywhenup.html">service startup notifications</a></tt> and <tt><a href="66-frontend.html">frontend</a></tt>.
If this file doesn't exist <tt>66-svctl</tt> will automatically change to lowercase <tt>r</tt> and warn the user about the change.
</li>
<li>
<tt>-X&nbsp;</tt>&nbsp;: exit. The supervisor of the service will exit too. This command should normally never be used on a working system.
</li>
<li>
<tt>-K&nbsp;</tt>&nbsp;: sends a SIGKILL to the <em>service</em> and keep it down.
</li>
</ul>
<h2> Note </h2>
<p>You can also send a signal in a similar fashion to a <em>'classic'</em> service with the <tt><a href="https://skarnet.org/software/s6/s6-svc.html">s6-svc</a></tt> tool which has the philosophy <em>"launch and forget"</em>.
In contrast to <tt>s6-svctl</tt> this does not care for the exit status of the service when a signal is sent.</p>
<p>As an extra convenience the <tt>-n</tt> options allow you to deal directly on the command line with
<em>max-death-tally</em> even if these were not specified explicitely in the services frontend file and no corresponding files exist.</p>
</body>
</html>
This diff is collapsed.
<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-echo</title>
<meta name="Description" content="Detailed documentation for the 66-echo command which is part of the 66 software suite" />
<meta name="Keywords" content="66 command 66-echo echo" />
<!-- <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-echo</h1>
<p>
Exact copy of <a href="https://skarnet.org/software/s6-portable-utils/s6-echo.html">s6-echo</a>. Adapted to the 66 tools suite to avoid a dependency on <a href="https://skarnet.org/software/s6-portable-utils/">s6&#8209;portable&#8209;utils</a> at compilation time of <tt>66</tt>. Details and further information on the command can be found at the <a href="https://skarnet.org/software/s6-portable-utils/s6-echo.html">s6&#8209;echo</a> documentation page.
</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-env</title>
<meta name="Description" content="Detailed documentation for the 66-env command which is part of the 66 software suite" />
<meta name="Keywords" content="66 command 66-env service supervision execute script execline environment read write modify" />
<!-- <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-env</h1>
<p>
Lists or replaces an environment variable of a service depending on the options passed.
</p>
<h2>Interface</h2>
<pre>
66-env [ -h ] [ -v <em>verbosity</em> ] [ -t <em>tree</em> ] [ -d <em>dir</em> ] [ -L ] [ -r <em>key=value</em> ] <em>service</em>
</pre>
<ul>
<li>
This program opens and reads the configuration file of <em>service</em> found by default at <em>/etc/66/conf</em>.
</li>
<li>
It displays the contents of the file or replaces a <em>key=value</em> pair if instructed to do so with the <tt>&#8209;r</tt> option.
</li>
</ul>
<h2> Exit codes</h2>
<p>
<ul>
<li>
<tt><b>&nbsp;&nbsp;0</b>&nbsp;:&nbsp;</tt>success
</li>
<li>
<tt><b>110</b>&nbsp;:&nbsp;</tt>bad usage
</li>
<li>
<tt><b>111</b>&nbsp;:&nbsp;</tt>system call failed
</li>
</ul>
</p>
<h2>Options</h2>
<ul>
<li>
<tt><b>-h</b></tt> : print this help.
</li>
<li>
<tt><b>-v <em>verbosity</em></b></tt> : increase/decrease 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>-t <em>tree</em></b></tt> : ignored. Provides internal compatibility for <tt>66</tt> tools.
</li>
<li>
<tt><b>-d <em>dir</em></b></tt> : use <em>dir</em> as configuration file directory instead of the default one.
</li>
<li>
<tt><b>-L</b></tt> : list defined environment variables for <em>service</em>.
</li>
<li>
<tt><b>-r&nbsp;<em>key=value</em></b></tt> : override an existing <em>key=value</em> pair with the given one. The <em>key=value</em> needs to be double-quoted in case of multiple arguments. Backslash '\' should be used to properly parse a double-quoted element.
</li>
</ul>
<h2> Usage examples</h2>
<ul>
<pre>66-env -L ntpd</pre>
<pre>66-env -r CMD_ARGS=-d </pre>
<pre>66-env -r "CMD_ARGS=-c /etc/nginx/nginx.conf -g \"daemon off;\""</pre>
</ul>
<h2>Notes</h2>
<p>
Keys which are preceded by an exclamation mark "!" in the configuration <em>service</em> file can be accessed as if they had none. For example, a <tt>key=value</tt> corresponding to:
</p>
<ul>
<pre>!CMD_ARGS=--print-pid=4</pre>
</ul>
<p>can be replaced by the command:</p>
<ul>
<pre>66-env -r CMD_ARGS=--print-pid=3</pre>
</ul>
<p>
In this case the operator will be kept even if it was not included in the overwriting command.
</p>
</ul>
</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-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>
<strong>Deprecated</strong>. See <a href="execl-envfile.html">execl-envfile</a> instead.
</p>
</body>
</html>