Files
elog/elogd.init_template
T
ritt 6a823fb603 Added 1s dealay to restart
SVN revision: 1621
2006-01-19 08:19:21 +00:00

68 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
# chkconfig: 3 90 10
# description: ELOG is a weblog with integrated database
# processname: elogd
# config: @PREFIX@/elog/elogd.cfg
# pidfile: /var/run/elogd.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Check for the config file
if [ ! -f @PREFIX@/elog/elogd.cfg ]; then
exit 0
fi
# See how we were called.
case "$1" in
start)
if [ -f /var/run/elogd.pid ] ; then
pid=`cat /var/run/elogd.pid`
if [ -d /proc/$pid ] ; then
echo "elogd already running"
echo_failure
exit 1
fi
fi
echo -n "Starting elogd: "
@PREFIX@/sbin/elogd -D -c @PREFIX@/elog/elogd.cfg > /dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
touch /var/lock/subsys/elogd
echo_success
else
echo_failure
fi
echo
;;
stop)
echo ""
if [ -f /var/run/elogd.pid ] ; then
echo -n "Stoping elogd: "
/bin/kill `cat /var/run/elogd.pid`
rm -f /var/lock/subsys/elogd
rm -f /var/run/elogd.pid
echo_success
echo
else
echo -n "No elogd running?"
echo_failure
echo
fi
;;
restart|reload)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0