This is a significant rewrite of daemontools written by djb. This version of daaemontools is a component of indimail-mta, but can be used independently.
Few of the changes are
- run shutdown script in dir/shutdown on svc -d, svc -r
- run alert scripts when services go down abnormally
- systemctl unit file for linux, rc for FreeBSD, launchd unit file for OSX
- Use of /run, /var/run to allow readonly service directory
- Logging of svscan output
- Private namespace for filesystems mounted by services under svscan
- Configurable scan interval
- Run initializtion commands on svscan startup
- Addtional actions in svc command (-r, -1, -2)
- svps command to pretty print service status
- Ability for a service to wait for another service
- New fifo supervise/up which services can open to test if service is up or down.
- Additional information in svstat (wait status, supervise pid)
- rpm/debian packages along with create_rpm, create_debian scripts
- Return the status of supervise/service in svstat itself.
- enhanced envdir utility that can load environment variables from multiple directories and -c option to clear existing environment variables on startup.
- man pages for all commands
- docker-entrypoint to svscan
- functional as init replacement in docker/podman environment.
- ability to become session leader if SETSID env variable is set
- create .svscan.pid file
- Linked with libqmail to avoid duplication of functions and ease of maintenance. This also implies use of substdio interface instead of buffer interface for standard input / output
To configure the build for daemontools, you need to configure conf-prefix, conf-qmail, conf-sysconfdir, conf-shared, conf-libexec and conf-servicedir. Defaults are given in the table below. If you are ok with the defaults, you can run the script default.configure to set the below values.
Linux
config file | value |
---|---|
conf-prefix | /usr |
conf-qmail | /var/indimail |
conf-sysconfdir | /etc/indimail |
conf-shared | /usr/share/indimail |
conf-libexec | /usr/libexec/indimail |
conf-servicedir | /service |
FreeBSD, Darwin
config file | value |
---|---|
conf-prefix | /usr/local |
conf-qmail | /var/indimail |
conf-sysconfdir | /usr/local/etc/indimail |
conf-shared | /usr/local/share/indimail |
conf-libexec | /usr/local/libexec/indimail |
conf-servicedir | /usr/local/etc/indimail/sv |
The build below depends on several Makefiles. For the build to operate without errors, you need to run default.configure the first time and everytime after you do a make clean
. If you don't run default.configure, you can run replace make
with ./qmake
$ ./default.configure
$ cd /usr/local/src/indimail-mta/daemontools-x
$ make or ./qmake
$ sudo make install or sudo ./qmake install
(check version in indimail-mta/daemontools-x/conf-version)
For more details look at README