diff options
author | martti <martti> | 2004-07-07 12:38:39 +0000 |
---|---|---|
committer | martti <martti> | 2004-07-07 12:38:39 +0000 |
commit | 19364f66a82afa881d460d9b7070c3984f1b11a8 (patch) | |
tree | e44538e8c53e58478197f4dae68e78155b267378 /devel | |
parent | 4b466d1418777e4f83fefe3616420b5e06283df4 (diff) | |
download | pkgsrc-19364f66a82afa881d460d9b7070c3984f1b11a8.tar.gz |
Make this work on non-NetBSD systems
Diffstat (limited to 'devel')
-rwxr-xr-x | devel/distcc/files/distccd.sh | 50 |
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 |