summaryrefslogtreecommitdiff
path: root/devel/distcc
diff options
context:
space:
mode:
authormartti <martti>2004-07-07 12:38:39 +0000
committermartti <martti>2004-07-07 12:38:39 +0000
commit9a301f3bd461627a584eee9c96934b2540f60180 (patch)
treee44538e8c53e58478197f4dae68e78155b267378 /devel/distcc
parenta0932142e5602dec8f1e8367811a26f5677a3db8 (diff)
downloadpkgsrc-9a301f3bd461627a584eee9c96934b2540f60180.tar.gz
Make this work on non-NetBSD systems
Diffstat (limited to 'devel/distcc')
-rwxr-xr-xdevel/distcc/files/distccd.sh50
1 files changed, 43 insertions, 7 deletions
diff --git a/devel/distcc/files/distccd.sh b/devel/distcc/files/distccd.sh
index 92cc43bf465..e82538e4815 100755
--- a/devel/distcc/files/distccd.sh
+++ b/devel/distcc/files/distccd.sh
@@ -1,17 +1,53 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: distccd.sh,v 1.2 2004/05/02 19:31:48 xtraeme Exp $
+# $NetBSD: distccd.sh,v 1.3 2004/07/07 12:38:39 martti Exp $
#
# PROVIDE: distccd
# BEFORE: DAEMON
-. /etc/rc.subr
+if [ -f /etc/rc.subr ]; then
+ . /etc/rc.subr
+fi
name="distccd"
-rcvar=$name
-command="/usr/pkg/bin/${name}"
-command_args='--daemon --pid-file /var/run/distccd.pid --user nobody'
+rcvar="${name}"
+command="@PREFIX@/bin/${name}"
+command_args="--daemon --pid-file /var/run/${name}.pid --user nobody"
+pidfile="/var/run/${name}.pid"
-load_rc_config $name
-run_rc_command "$1"
+if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -f /etc/rc.d/DAEMON ]; then
+ load_rc_config $name
+ run_rc_command "$1"
+else
+ case ${1:-start} in
+ start)
+ if [ -x ${command} ]; then
+ echo "Starting ${name}."
+ eval ${command} ${distccd_flags} ${command_args}
+ fi
+ ;;
+ stop)
+ if [ -f ${pidfile} ]; then
+ pid=`/bin/head -1 ${pidfile}`
+ echo "Stopping ${name}."
+ kill -TERM ${pid}
+ else
+ echo "${name} not running?"
+ fi
+ ;;
+ restart)
+ ( $0 stop )
+ sleep 1
+ $0 start
+ ;;
+ status)
+ if [ -f ${pidfile} ]; then
+ pid=`/bin/head -1 ${pidfile}`
+ echo "${name} is running as pid ${pid}."
+ else
+ echo "${name} is not running."
+ fi
+ ;;
+ esac
+fi