-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathelogd.init
71 lines (64 loc) · 1.36 KB
/
elogd.init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/sh
# chkconfig: 3 90 10
# description: ELOG is a weblog with integrated database
# processname: elogd
# config: /usr/local/elog/elogd.cfg
# pidfile: /var/run/elogd.pid
# Check for the config file
if [ ! -f /usr/local/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
if [ -f /var/run/elogd.pid ] ; then
rm -f /var/lock/subsys/elogd
rm -f /var/run/elogd.pid
fi
echo -n "Starting elogd: "
/usr/local/sbin/elogd -D -c /usr/local/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
fi
;;
status)
status -p /var/run/elogd.pid /usr/local/sbin/elogd
RETVAL=$?
;;
restart|reload)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
esac
exit 0