#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-p2p/gift/files/gift.initd,v 1.7 2006/04/19 02:10:48 squinky86 Exp $ depend() { need net } start() { ebegin "Starting giFTd" start-stop-daemon --quiet --start -c ${USER} --make-pidfile \ --pidfile /var/run/giftd.pid --exec /usr/bin/giftd \ --nicelevel ${NICE} -- \ --local-dir=${LOCAL_DIR} &>${LOG} & result=$? sleep 1 [ -z "`pgrep -u ${USER} giftd`" ] && result=1 if [ $result -eq 1 ]; then eerror "Failed to start gift. Check ${LOG} for more information" fi; eend $result } stop() { ebegin "Stopping giFTd - please wait" start-stop-daemon --stop --quiet --pidfile /var/run/giftd.pid eend $? } restart() { svc_stop sleep 10 svc_start }