File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / thttpd / scripts / thttpd_wrapper
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 17:21:13 2012 UTC (12 years, 4 months ago) by misho
Branches: thttpd, MAIN
CVS tags: v2_25b, HEAD
thttpd

#!/bin/sh
#
# thttpd_wrapper - wrapper script for thttpd on FreeBSD
#
# This goes in /usr/local/sbin.  It runs thttpd in a loop.  If thttpd
# exits then the script restarts it automatically.
#
# The -D flag tells thttpd to *not* put itself into the background,
# and the -C flag tells it to get the rest of its configuration from
# the specified config file.

while true ; do
    /usr/local/sbin/thttpd -D -C /usr/local/www/thttpd_config
    if [ -f /var/run/nologin ] ; then
	exit
    fi
    sleep 10
    egrep ' thttpd\[' /var/log/messages |
      tail -33 |
      mail -s "thttpd on `hostname` restarted" root
done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>