#!/sbin/runscript # Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-scheme/hop/files/hop.initd,v 1.1 2010/04/09 00:39:58 chiiph Exp $ HOPEXEC=/usr/bin/hop HOPUSER=hop HOPHOME=/var/www PIDFILE=/var/run/hop.pid LOGFILE=/var/log/hop # For user extensions through /etc/conf.d/hop HOP_OPTS="--log-file ${LOGFILE} ${HOP_OPTS}" depend() { need localmount net } logfile() { if [ ! -f ${LOGFILE} ] then touch ${LOGFILE} fi chown ${HOPUSER} ${LOGFILE} || eerror "Cannot create logfile" return 0 } start() { logfile || return 1 ebegin "Starting Hop Web Broker" start-stop-daemon --start --oknodo \ --background --chuid ${HOPUSER} \ --make-pidfile --pidfile ${PIDFILE} \ --exec ${HOPEXEC} --env HOME=${HOPHOME} \ -- ${HOP_OPTS} eend $? } stop() { ebegin "Stopping Hop Web Broker" start-stop-daemon --stop \ --exec ${HOPEXEC} --pidfile ${PIDFILE} eend $? }