summaryrefslogtreecommitdiff
path: root/devel/distcc
diff options
context:
space:
mode:
authormartti <martti@pkgsrc.org>2004-07-07 12:38:39 +0000
committermartti <martti@pkgsrc.org>2004-07-07 12:38:39 +0000
commit470f11a70af499399918f2d00fe76053c407501c (patch)
treee44538e8c53e58478197f4dae68e78155b267378 /devel/distcc
parent22fa604f5e2ce086070bc7338bf13a8a8cae9ae1 (diff)
downloadpkgsrc-470f11a70af499399918f2d00fe76053c407501c.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