summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-servers/cherokee/files/cherokee-initd-1.2.99')
-rw-r--r--www-servers/cherokee/files/cherokee-initd-1.2.9967
1 files changed, 67 insertions, 0 deletions
diff --git a/www-servers/cherokee/files/cherokee-initd-1.2.99 b/www-servers/cherokee/files/cherokee-initd-1.2.99
new file mode 100644
index 00000000000..ad4fb7f2d86
--- /dev/null
+++ b/www-servers/cherokee/files/cherokee-initd-1.2.99
@@ -0,0 +1,67 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/sbin/cherokee"
+extra_commands="configtest"
+extra_started_commands="graceful reload"
+
+
+depend() {
+ need net
+ use dns ldap logger mysql netmount
+}
+
+checkconfig() {
+ ${command} -t 1>/dev/null 2>&1
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "${SVCNAME} has detected an error in your config:"
+ ${command} -t ${CHEROKEE_OPTS}
+ fi
+ return $?
+}
+
+configtest() {
+ ebegin "Checking ${SVCNAME} configuration"
+ checkconfig
+ eend $?
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --quiet \
+ --exec ${command} -- -d ${CHEROKEE_OPTS}
+ eend $?
+}
+
+stop() {
+ checkconfig || return 1
+
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --quiet \
+ --exec ${command}
+ eend $?
+}
+
+graceful() {
+ checkconfig || return 1
+
+ ebegin "Restarting ${SVCNAME} and closing all the opened connections"
+ start-stop-daemon \
+ --exec ${command} \
+ --signal USR1
+ eend $?
+}
+
+reload() {
+ checkconfig || return 1
+
+ ebegin "Reloading ${SVCNAME} configuration"
+ start-stop-daemon \
+ --exec ${command} \
+ --signal HUP
+ eend $?
+}