#!/sbin/openrc-run # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 extra_commands="configtest" POUND="/usr/sbin/pound" CONFIGFILE="${CONFIGFILE:-/etc/pound.cfg}" PIDFILE="${PIDFILE:-/var/run/pound.pid}" LOGDIR="${LOGDIR:-/var/log/pound}" depend() { need net } configtest() { ebegin "Checking ${SVCNAME} configuration" checkconfig eend $? } checkconfig() { $POUND -v -c || return 1 return $? } start() { ebegin "Starting pound" if [ ! -f "$CONFIGFILE" ]; then eend 1 "configfile $CONFIGFILE not found." fi checkpath -d -o ${POUND_USER:=nobody}:${POUND_GROUP:=nobody} -m 0750 $LOGDIR checkconfig && start-stop-daemon --quiet --start --exec $POUND -- -f $CONFIGFILE -p $PIDFILE eend $? } stop() { if [ "${RC_CMD}" = "restart" ]; then checkconfig || return 1 fi ebegin "Stopping pound" start-stop-daemon --quiet --stop --pidfile $PIDFILE eend $? }