Sophie

Sophie

distrib > Mandriva > 2010.1 > i586 > by-pkgid > 316efc02d536d4b92c8317d8c88ba3f8 > files > 1

nulog-2.1.5-1mdv2010.1.src.rpm

#!/bin/bash
#
# nulog	Init script to control (start/stop/reload)
#
# chkconfig: 345 40 60
# description: nulog - the NuLog firewall log analysis tool
# probe: false
# processname: nulog
# pidfile: /var/run/nulog.pid

# Comments to support LSB init script conventions

### BEGIN INIT INFO
# Provides:          nulog
# Required-Start:    $syslog
# Required-Stop:     $syslog
# Should-Start:      $local_fs
# Should-Stop:       $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Control script for NuLog
# Description:       Init script to control (start/stop/reload)
#                    the NuLog firewall log analysis tool.
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

application=/usr/sbin/nulog.tac

rundir=/var/run/nulog/
pidfile=$rundir/nulog.pid
logfile=/var/log/nulog.log

test -x $application || exit 0

RETVAL=0
start() {
        gprintf "Starting nulog: "
        ## daemon nulog.tac $OPTIONS
        daemon $application --pidfile=$pidfile --logfile=$logfile
        RETVAL=$?
	echo
        [ $RETVAL = 0 ] && touch /var/lock/subsys/nulog
        return $RETVAL
}
stop() {
	gprintf "Stopping nulog: "
	killproc -p $pidfile
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/nulog
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
        status -p $pidfile
	RETVAL=$?
	;;
  restart|reload)
	stop
	start
	;;
  condrestart)
	if [ -f /var/lock/subsys/nulog ] ; then
	    stop
	    start
	fi
	;;
  *)
	gprintf "Usage: %s {start|stop|status|restart|condrestart|reload}\n" "$0"
	exit 1
esac

exit $RETVAL