summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-servers/thttpd/files/thttpd.init')
-rw-r--r--www-servers/thttpd/files/thttpd.init26
1 files changed, 26 insertions, 0 deletions
diff --git a/www-servers/thttpd/files/thttpd.init b/www-servers/thttpd/files/thttpd.init
new file mode 100644
index 000000000000..6e1878f740fa
--- /dev/null
+++ b/www-servers/thttpd/files/thttpd.init
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+# Copyright 1999-2012 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.init,v 1.1 2012/03/24 02:59:02 blueness 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
+ start-stop-daemon --quiet --start --exec /usr/sbin/thttpd \
+ --pidfile /var/run/thttpd.pid --chdir "$THTTPD_DOCROOT" -- \
+ ${THTTPD_OPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping thttpd"
+ start-stop-daemon --quiet --stop --pidfile /var/run/thttpd.pid
+ eend $?
+}