diff options
author | martti <martti@pkgsrc.org> | 2004-07-07 12:38:39 +0000 |
---|---|---|
committer | martti <martti@pkgsrc.org> | 2004-07-07 12:38:39 +0000 |
commit | 4e2c53a10fb87b5e0713031b10ab291fa3a33b66 (patch) | |
tree | e44538e8c53e58478197f4dae68e78155b267378 /devel/distcc | |
parent | 297652ef07711118069ea8a8c1cf82d14d6e3a18 (diff) | |
download | pkgsrc-4e2c53a10fb87b5e0713031b10ab291fa3a33b66.tar.gz |
Make this work on non-NetBSD systems
Diffstat (limited to 'devel/distcc')
-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 |