-
Notifications
You must be signed in to change notification settings - Fork 0
/
ldapgraph
executable file
·71 lines (57 loc) · 1.34 KB
/
ldapgraph
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
71
#!/bin/sh
# $Id$
#
# init script for ldapgraphd
#
# chkconfig: 2345 82 28
# description: ldapgraph LDAP log grapher.
#
# processname: ldapgraphd
# pidfile: /var/run/ldapgraph.pid
# ldapgraph -- An rrdtool-based graphing tool for LDAP server (389DS,
# RHDS, Sun DS, OpenLDAP statistics)
# copyright (c) 2006-2011 Chris St. Pierre <[email protected]>
# based on mailgraph copyright (c) 2000-2005 David Schweikert <[email protected]>
# released under the GNU General Public License
# Source function library.
. /etc/init.d/functions
LOCK_FILE=/var/lock/subsys/ldapgraph
[ -e /etc/sysconfig/ldapgraph ] && . /etc/sysconfig/ldapgraph
case "$1" in
'start')
if [ -n ${LOGFILE} ]; then
ARGS="-l ${LOGFILE}"
else
ARGS="-I ${INSTANCE}"
fi
if [ -n ${PIDFILE} ]; then
ARGS="${ARGS} --pidfile=${PID_FILE}"
fi
if [ -z $LDAPGRAPHD ]; then
LDAPGRAPHD=ldapgraphd
fi
ARGS="${ARGS} -d --rrddir=${RRD_DIR}"
echo -n "Starting ldapgraph";
daemon ${LDAPGRAPHD} ${ARGS}
RETVAL=$?
echo
[ ${RETVAL} -eq 0 ] && touch ${LOCK_FILE}
exit ${RETVAL}
;;
'stop')
echo -n "Stopping ldapgraph";
killproc ${LDAPGRAPHD}
RETVAL=$?
echo
[ ${RETVAL} -eq 0 ] && rm ${LOCK_FILE}
exit ${RETVAL}
;;
'restart')
$0 stop; $0 start;
;;
*)
echo "Usage: $0 { start | stop | restart }"
exit 1
;;
esac
exit 0