diff options
Diffstat (limited to 'www-servers/thttpd/files/thttpd-2.25/thttpd.init')
-rw-r--r-- | www-servers/thttpd/files/thttpd-2.25/thttpd.init | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/www-servers/thttpd/files/thttpd-2.25/thttpd.init b/www-servers/thttpd/files/thttpd-2.25/thttpd.init new file mode 100644 index 000000000000..9adec9c797a6 --- /dev/null +++ b/www-servers/thttpd/files/thttpd-2.25/thttpd.init @@ -0,0 +1,33 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/www-servers/thttpd/files/thttpd-2.25/thttpd.init,v 1.1 2004/08/08 18:34:03 stuart Exp $ + +depend() { + need net +} + +start() { + ebegin "Starting thttpd" + if [ ! -d "$THTTPD_DOCROOT" ]; then + eend 1 "THTTPD_DOCROOT not set correctly in /etc/conf.d/thttpd" + exit 1 + fi + cd $THTTPD_DOCROOT + if [ $? -ne 0 ]; then + eend $? "ERROR: cannot change to docroot \"$THTTPD_DOCROOT\"" + fi + start-stop-daemon --quiet --start --startas /usr/sbin/thttpd \ + --pidfile /var/run/thttpd.pid -- ${THTTPD_OPTS} + eend $? +} + +stop() { + local rc + + ebegin "Stopping thttpd" + start-stop-daemon --quiet --stop --pidfile /var/run/thttpd.pid + rc=$? + rm -f /var/run/thttpd.pid + eend $rc +} |