Skip to content

svscanboot.8

Manvendra Bhangui edited this page Oct 22, 2024 · 8 revisions

NAME

svscanboot - start svscan in service directories, with output/error logged through multilog / journalctl

SYNOPSIS

svscanboot [ scandir ]

DESCRIPTION

svscanboot (without any command-line arguments) runs svscan command with descriptor 0, 1 and 2 redirected to /dev/null.

svscan /service

You can configure the default scandir to be used when svscanboot is invoked, without any arguments, in /etc/indimail/control/servicedir.conf.

If svscanboot is given a command-line argument, it starts up svscan for the directory scandir given on the command line (instead of /service or scandir configured in servicedir.conf).

svscanboot uses envdir(8) on /service/.svscan/variables to set environment variables and clear all other environment variables.

If you pass scandir argument to svscan, /service gets replaced by scandir.

All output of svscan on descriptors 1 and 2 gets logged to /var/log/svc/svc/svscan/current using multilog(8) with following script in /service/.svscan/log/run.

#!/bin/sh
exec /usr/bin/setuidgid qmaill /usr/sbin/multilog t /var/log/svc/svscan

You can log the svscan output to systemd journal by calling splogger(8) in /service/.svcan/log/run. If splogger is used, you can use journalctl(1) to view svscan logs.

#!/bin/sh
exec /usr/bin/setuidgid qmaill splogger svscan

You can set the following typical variables in /service/.svscan/variables directory.

 PATH
 SCANINTERVAL  - If set, svscan(8) uses this to look for new services every
                 SCANINTERVAL seconds.
 STATUSFILE    - Used by svscan(8)
 INITCMD       - If set, svscan(8) runs this command using /bin/sh, before
                 running supervise(8).
 WAIT_INITCMD  - If set, svscan(8) waits for this INIT_CMD to finish before
                 starting supervise(8)
 SCANLOG       - If set, svscan(8) logs all messages and errors using
                 multilog with instructions in
                 servicedir/.svscan/log/run. If not
                 set, svscanboot(8) pipes stdout, stderr of svscan(8) to
                 readproctitle(8)
 UNSHARE       - If set, svscanboot(8) uses unshare --mount command to run
                 svscan(8)
 VERBOSE       - Display informational messages.
 SILENT        - Supress warning messages

The recommended old way was to put the following entry in /etc/inittab to invoke svscanboot.

SV:345:respawn:/usr/libexec/indimail/svscanboot <>/dev/console 2<>/dev/console

Many of the current operating systems use systemd(1) replacement for init(1). svcanboot(8) should be invoked by your boot scripts - systemd(1), upstart(1), init(1) or boot rc scripts. Then standard systemd service script setup by indimail-mta is

[Unit]
Description=SVscan Service
After=local-fs.target network.target

[Service]
ExecStart=/usr/libexec/indimail/svscanboot /service
ExecStop=/usr/bin/qmailctl stop
Restart=on-failure
RestartSec=10
Type=simple
PrivateTmp=no

[Install]
Alias=indimail.service
Alias=indimail-mta.service
WantedBy=multi-user.target

SEE ALSO

init(1) supervise(8), svc(8), svok(8), svstat(8), svscan(8), svctool(8), envdir(8), readproctitle(8), fghack(8), pgrphack(8), multilog(8), tai64n(8), tai64nlocal(8), setuidgid(8), envuidgid(8), envdir(8), softlimit(8), setlock(8), unshare(1) unshare(2) svps(1), systemd(1) journalctl(1) ps(1) http://cr.yp.to/daemontools.html

Clone this wiki locally