cpsv - utility to install and manage runit services
cpsv [-f] a <service-name> ...
cpsv p <service-name>
cpsv d <service-name>
cpsv [-f] s
cpsv l
cpsv is a tool to install runscripts from CPSV_SOURCE to
CPSV_DEST. It can also be used to manage runscripts that are already
installed in CPSV_DEST.
By default in a Debian system, CPSV_SOURCE is /usr/share/runit/sv and
CPSV_DEST is /etc/sv.
Usually packages install runscripts directly in /etc/sv/ but it's also
possible to install the runscript in /usr/share/runit/sv and maintain
a copy of it in /etc/sv/. This is especially useful for packages that
provide a large number of runscripts without the corresponding binaries,
like runit-services.
- a
- Copy <service> from CPSV_SOURCE into CPSV_DEST, then create
symlinks as when the p command is used; more than one
<service> name can be given with this command and each
<service> directory must exists in CPSV_SOURCE.
If <service> already exists in CPSV_DEST, cpsv prints a
warning, the cp invocation is skipped and the return code is increased by
one. The -f option can be used to change this behaviour.
- p
- Populate the <service> directory with symlinks; a
<service> directory in CPSV_DEST must already exist.
If a <service>/supervise symlink or directory is not found,
cpsv creates one. If a <service>/.meta/finish file exists,
and a <service>/finish file or symlink is not found, cpsv
creates a symlink to /lib/runit/finish-exec.
When a <service>/log directory exists: if
<service>/log/supervise link or directory is not found, cpsv
creates one; if <service>/log/run file or symlink is not
found, cpsv creates a symlink to /etc/sv/svlogd/run.
- d
- Print the diff between the <service> directory that would be
created with the a command and the current <service>
directory in CPSV_DEST. The exit status of diff is returned; a
<service> directory must exists in CPSV_SOURCE.
supervise , conf and wtime are excluded from the
diff.
- s
- Sync CPSV_DEST with CPSV_SOURCE; for each <service> directory
in CPSV_SOURCE cpsv search the system for a systemd or sysv service
file with the same name: if it finds one then it copies the
<service> directory as when the a command is given and
goes to the next directory; else cpsv looks for the path written in
a <service>/.meta/bin file, and if such path exists in the
system then it copies the <service> directory as when the
a command is given; otherwise it goes to the next directory.
- l
- List installed services in CPSV_DEST; the name of each
<service> that would be copied with the s command is
printed, preceded with character surronded by square brakets;
[a]: <service>;
exists in CPSV_SOURCE but not in CPSV_DEST
[i]: <service>;
exists both in CPSV_SOURCE and CPSV_DEST, the copy in CPSV_DEST is
identical
to the one created with the a command
[l]: <service>;
exists both in CPSV_SOURCE and CPSV_DEST, the copy in CPSV_DEST is
different
from the one created with the a command
- -f
- Overwrite <service> files in CPSV_DEST with
<service> files in CPSV_SOURCE, no backup is provided. When a
<service>/log directory exists, the
<service>/log/run file or symlink is replaced with the
default one that is created with the p command; supervise
directories or symlinks are never overwritten or replaced this way.
- CPSV_DEST
- The environment variable $CPSV_DEST overrides the default directory where
services are copied. If omitted or empty, the default is
/etc/sv
- CPSV_SOURCE
- The environment variable $CPSV_SOURCE overrides the default directory from
where services are copied. If omitted or empty, the default is
/usr/share/runit/sv
Lorenzo Puliti <plorenzo@disroot.org>