#!/bin/sh
#
# chkconfig: - 81 19
# description: ulogd is the userspace logging daemon for netfilter/iptables
#


. /etc/rc.d/init.d/functions

prog="ulogd"

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

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

function start()
{
	echo -n $"Starting $prog: "
	daemon /usr/sbin/ulogd -d
	echo
	touch /var/lock/subsys/ulogd
}


function stop()
{
	echo -n $"Stopping $prog: "
	killproc ulogd
	echo
	rm -f /var/lock/subsys/ulogd
}


function reload()
{
    echo -n $"Reloading $prog: "
	pid=`pidof ulogd`
	if [ "x$pid" != "x" ]; then
		kill -HUP $pid 2>/dev/null
	fi
	touch /var/lock/subsys/ulogd
}


case "$1" in
  start)
	start
	;;
  stop)
  	stop
	;;
  restart)
	stop
	start
	;;
  reload)
	reload
	;;
  status)
	status ulogd
	;;
  *)
	echo $"Usage: $0 {start|stop|status|restart|reload}"
	exit 2
esac

exit 0
