summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/yacsd/files/yacsd.rc-0.6.0_pre20070201')
-rwxr-xr-xnet-misc/yacsd/files/yacsd.rc-0.6.0_pre2007020159
1 files changed, 59 insertions, 0 deletions
diff --git a/net-misc/yacsd/files/yacsd.rc-0.6.0_pre20070201 b/net-misc/yacsd/files/yacsd.rc-0.6.0_pre20070201
new file mode 100755
index 0000000..bcf41de
--- /dev/null
+++ b/net-misc/yacsd/files/yacsd.rc-0.6.0_pre20070201
@@ -0,0 +1,59 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/yacsd/files/yacsd.rc6.2.2.9,v 1.1 2006/03/07 21:07:20 ferdy Exp $
+
+opts="${opts} configtest reload"
+
+YACSD="${YACSD:-/usr/bin/yacsd}"
+PIDFILE="${PIDFILE:-/var/run/yacsd.pid}"
+YACSD_OPTS="${YACSD_OPTS:---config=/etc/yacs-0.6/yacsd.conf --pidfile=${PIDFILE}}"
+
+depend() {
+ need logger dns net mysql
+}
+
+checkconfig() {
+ ${YACSD} ${YACSD_OPTS} -t
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ eerror "yacsd has detected an error in configuration files."
+ fi
+ return $ret
+}
+
+configtest() {
+ ebegin "Checking yacsd Configuration"
+ checkconfig
+ eend $?
+}
+
+start() {
+ checkconfig || return $?
+
+ ebegin "Starting yacsd"
+ ${YACSD} ${YACSD_OPTS} &>/dev/null
+ eend $?
+}
+
+stop() {
+ pid=$(cat ${PIDFILE})
+ ebegin "Stopping yacsd (pid=${pid})"
+
+ kill -TERM ${pid}
+
+ for i in `seq 10`; do
+ ps -C yacsd -o pid= | grep -q ${pid} && break
+ sleep 1
+ done
+
+ ps -C yacsd -o pid= | grep -q ${pid}
+
+ eend $?
+}
+
+reload() {
+ ebegin "Reloading yacsd"
+ kill -HUP $(cat ${PIDFILE})
+ eend $?
+}