|
NAMEperpboot - startup utility for perpd(8) and an associated loggerSYNOPSISperpboot [-hV] [-dx] [ basedir ]DESCRIPTIONperpboot is a utility for starting and monitoring a perpd(8) instance on basedir with an associated logger. If basedir is not specified, perpboot will use the environmental variable PERP_BASE. If PERP_BASE is not set or empty, perpboot will use a compiled-in value for basedir, normally /etc/perp.Within basedir, perpboot switches into a subdirectory named .boot/. It then forks two child processes to exec ./rc.log and ./rc.perp, with a pipe connected between their respective stdin and stdout. Normally ./rc.log will be an executable script that execs into a stdin logger, such as tinylog(8) or sissylog(8). Similarly, ./rc.perp will be an executable script that ultimately execs into perpd(8). See the examples section below for sample scripts. perpboot sets up its ./rc.log and ./rc.perp child processes with an environment that:
By default, perpboot itself acts as lightweight supervisor for the ./rc.log and ./rc.perp child processes. If perpboot notices that either of these processes has died, it will try to restart them. OPTIONS
EXAMPLESAn example ./rc.log script may look like this:#!/bin/sh LOGDIR=/var/log/perpd exec tinylog -k 8 -s 100000 -t ${LOGDIR} This script execs into an instance of tinylog(8) maintaining a rotated set of log files in /var/log/perpd with a maximum of 8 keep files, a maximum log size of 100000 bytes, and with timestamp prepended entries. An example ./rc.perp script: #!/bin/sh exec perpd -a 6 $PERP_BASE Here the script execs into perpd(8) with autoscanning set to 6 seconds. Note also that the environmental variable PERP_BASE is defined and available for the ./rc.perp and ./rc.log scripts. These simple scripts could be customized and embellished considerably. For example, the ./rc.log script could:
Similarly, the ./rc.perp script could perform other initializations before the perpd(8) exec:
perpd itself may be invoked in the way that best suits the init(8) system and boot scripts of the host environment. A sysv-compatible system may use an inittab(5) file configured with this entry: PB:23456:respawn:/usr/sbin/perpboot -x /etc/perp This example shows the -x option, with the effect that init(8) itself will monitor the perpd(8) process and respawn it if it dies. A BSD-type system may use an rc.local file with this entry: if [ -x /usr/sbin/perpboot ]; then echo -n ' perpd' /usr/sbin/runenv -i /etc/perp/.boot/perp.env \ /usr/sbin/perpboot -d /etc/perp fi In this example, the -d option is used to run perpboot as a daemon process. This example is further embellished to show the use of the runenv(8) runtool to setup a clean environment for the perpd(8) process and its children. FILES/etc/perp/The default base operating directory for
perpd(8).
/etc/perp/.boot/ Directory containing the startup scripts used by
perpboot.
/etc/perp/.boot/rc.log Control script used by perpboot to start a logger
for perpd(8).
/etc/perp/.boot/rc.perp Control script used by perpboot to start up
perpd(8).
ENVIRONMENTPERP_BASEIf no basedir argument is given at the
command-line on startup, perpboot checks for a value defined by
PERP_BOOT. If this is not defined or empty, perpboot uses a compiled-in
default, normally /etc/perp.
SIGNALSIf perpboot gets the SIGTERM signal, it performs a shutdown sequence on its child processes:
Otherwise, when perpboot runs as a lightweight supervisor (without the -x option), it traps all the other signals it can and relays them directly to the ./rc.perp child process with kill(2). NOTESThe perpboot utility is a purpose-specific modification of rundeux(8).AUTHORWayne Marshall, http://b0llix.net/perp/SEE ALSOSee the perp-setup(8) utility for an ``automagic'' configuration of a perpboot installation.perp_intro(8), perp-setup(8), perpctl(8), perpd(8), perpetrate(5), perphup(8), perpls(8), perpok(8), perpstat(8), sissylog(8), tinylog(8), rundeux(8)
Visit the GSP FreeBSD Man Page Interface. |