--- init-script.in.org	2003-01-07 18:57:23.000000000 -0800
+++ init-script.in	2006-02-27 23:33:58.000000000 -0800
@@ -11,20 +11,7 @@
 # processname: nsca
 # config: /usr/local/nagios/etc/nsca.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
+. /etc/rc.common
 
 NscaBin=@bindir@/nsca
 NscaCfg=@sysconfdir@/nsca.cfg
@@ -35,7 +22,7 @@
   start)
 	# Start daemons.
 	echo -n "Starting nsca: "
-	daemon $NscaBin -s -c $NscaCfg
+	$NscaBin -s -c $NscaCfg
 	RETVAL=$?
 	echo
 	touch $LockFile
@@ -43,7 +30,9 @@
   stop)
 	# Stop daemons.
 	echo -n "Shutting down nsca: "
-	killproc nsca
+	pid=`ps axc|awk "{if (\\$5==\"nsca\") print \\$1}"`
+        /bin/kill $pid
+
 	echo
 	rm -f $LockFile
 	;;
@@ -52,7 +41,7 @@
 	$0 start
 	;;
   status)
-	status nsca
+	/bin/ps -ax |/usr/bin/grep nsca
 	;;
   *)
 	echo "Usage: nsca {start|stop|restart|status}"
