Program for daemonising and monitoring processes under OpenRC etc.
Go to file
Laurence Withers 639944b905 Simplify daemon and always close file descriptors
Use daemon(3) to daemonise rather than writing our own code. Since we
use the mode of daemon(3) which closes the standard 3 file descriptors,
if the user requests logging to one of those we dup(2) the original
first. We must also take care to always close any newly-opened file
descriptors before execve(2) of the child.
2012-10-02 19:58:05 +00:00
scripts Update build system 2012-10-02 09:54:56 +00:00
src/daemonitor Simplify daemon and always close file descriptors 2012-10-02 19:58:05 +00:00
.gitignore Import skeleton of daemonitor 2008-07-26 14:45:31 +00:00
COPYING Import skeleton of daemonitor 2008-07-26 14:45:31 +00:00
README Update build system 2012-10-02 09:54:56 +00:00
config Update build system 2012-10-02 09:54:56 +00:00
make.sh Update build system 2012-10-02 09:54:56 +00:00
run-test.sh Update build system 2012-10-02 09:54:56 +00:00
version Update build system 2012-10-02 09:54:56 +00:00

README

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

daemonitor
========================================================================
Copyright: ©20072012, Güralp Systems Limited
Author: Laurence Withers <lwithers@guralp.com>
License: GPLv3

See file COPYING for detail license information.

Really Quick Instructions
-------------------------

To build: ./make.sh
To install: ./make.sh install

You might want to edit 'config' first. You might also want to set
'INSTALL_PREFIX', which is prepended onto the destination of any installed
file.

Introduction
------------

Daemonitor is a daemon which starts and monitors a child process. It is
intended to be used with foreground child processes (e.g. daemons with a
foreground mode, or long-running processes which are always in the
foreground). Taken together, the daemonitor instance and its child process
represent a "standard" UNIX daemon process (i.e. backgrounded, PID file,
etc.).

The true purpose of daemonitor is to provide a robust way of monitoring
services under e.g. openrc, which provides a mechanism for starting, stopping
and querying services but does not have any automatic monitoring of its own.
Thus if a daemon or service crashes, this will not be recorded or addressed
by the system.

Daemonitor is a very small daemon which itself never exits. Its simple design
and single purpose should ensure that it is robust against various conditions
that may arise in the system (out of disk space, out of memory, ...), and
that it is unlikely to crash due to bugs. The process it monitors can then
crash or exit or be killed and daemonitor will detect this and restart it.

Instructions
------------

TODO