pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/distcc/files Make this work on non-NetBSD systems



details:   https://anonhg.NetBSD.org/pkgsrc/rev/80cf1e732884
branches:  trunk
changeset: 477707:80cf1e732884
user:      martti <martti%pkgsrc.org@localhost>
date:      Wed Jul 07 12:38:39 2004 +0000

description:
Make this work on non-NetBSD systems

diffstat:

 devel/distcc/files/distccd.sh |  50 ++++++++++++++++++++++++++++++++++++------
 1 files changed, 43 insertions(+), 7 deletions(-)

diffs (64 lines):

diff -r da938957d885 -r 80cf1e732884 devel/distcc/files/distccd.sh
--- a/devel/distcc/files/distccd.sh     Wed Jul 07 12:38:24 2004 +0000
+++ b/devel/distcc/files/distccd.sh     Wed Jul 07 12:38:39 2004 +0000
@@ -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



Home | Main Index | Thread Index | Old Index