--- init-script.in.org	2003-01-07 17:11:36.000000000 -0800
+++ init-script.in	2006-07-01 14:57:07.000000000 -0700
@@ -12,38 +12,24 @@
 # config: /usr/local/nagios/etc/nrpe.cfg
 
 
-# Source function library
-if [ -f /etc/rc.d/init.d/functions ]; then
-. /etc/rc.d/init.d/functions
-elif [ -f /etc/init.d/functions ]; then
-. /etc/init.d/functions
-elif [ -f /etc/rc.d/functions ]; then
-. /etc/rc.d/functions
-fi
-
-# Source networking configuration.
-. /etc/sysconfig/network
-
-# Check that networking is up.
-[ ${NETWORKING} = "no" ] && exit 0
-
 NrpeBin=@bindir@/nrpe
 NrpeCfg=@sysconfdir@/nrpe.cfg
-LockFile=/var/lock/subsys/nrpe
+LockFile=__PREFIX__/var/run/nrpe/nrpe.lock
 
 # See how we were called.
 case "$1" in
   start)
 	# Start daemons.
 	echo -n "Starting nrpe: "
-	daemon $NrpeBin -c $NrpeCfg -d
+	$NrpeBin -c $NrpeCfg -d
 	echo
 	touch $LockFile
 	;;
   stop)
 	# Stop daemons.
 	echo -n "Shutting down nrpe: "
-	killproc nrpe
+	pid=`ps axc|awk "{if (\\$5==\"nrpe\") print \\$1}"`
+	/bin/kill $pid
 	echo
 	rm -f $LockFile
 	;;
@@ -52,7 +38,7 @@
 	$0 start
 	;;
   status)
-	status nrpe
+	/bin/ps -ax |/usr/bin/grep nrpe
 	;;
   *)
 	echo "Usage: nrpe {start|stop|restart|status}"