blob: 9d8083e4f9964b23f6d6d190d31c11b06aed8009 (
plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
#!/bin/sh
#
# ldirectord Linux Director Daemon
#
# chkconfig: - 92 40
# description: Start and stop ldirectord on non-heartbeat systems
# Using the config file /etc/ha.d/ldirectord.cf
# Normally ldirectord is started and stopped by heartbeat
#
# processname: ldirectord
# config: /etc/ha.d/ldirectord.cf
#
# Author: Horms <horms@vergenet.net>
# Released: April 2000
# Licence: GNU General Public Licence
#
### BEGIN INIT INFO
# Provides: ldirectord
# Required-Start: $syslog $network $remote_fs
# Required-Stop: $syslog $network $remote_fs
# Should-Start: $time sshd
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Control Linux Virtual Server via ldirectord on non-heartbeat systems
# Description: Starts (and stops) the ldirectord service if
# running outside a heartbeat managed environment.
# ldirectord manages the Linux Virtual Server component for
# TCP/UDP load-balancing.
# It uses the config file @sysconfdir@/ha.d/ldirectord.cf.
### END INIT INFO
DAEMON=@sbindir@/ldirectord
# Source function library.
if
[ -f /etc/rc.d/init.d/functions ]
then
. /etc/rc.d/init.d/functions
fi
[ -x $DAEMON ] || exit 0
action() {
echo -n "$1... "
shift
$@
stat=$?
if [ $stat = 0 ]; then
echo success
else
echo failure
fi
return $stat
}
######################################################################
# Read arument and take action as appropriate
######################################################################
case "$1" in
start)
action "Starting ldirectord" $DAEMON start
touch /var/lock/subsys/ldirectord
;;
stop)
action "Stopping ldirectord" $DAEMON stop
rm -f /var/lock/subsys/ldirectord
;;
restart)
action "Restarting ldirectord" $DAEMON restart
;;
try-restart)
action "Try-Restarting ldirectord" $DAEMON try-restart
;;
status)
$DAEMON status
;;
reload)
action "Reloading ldirectord" $DAEMON reload
;;
force-reload)
action "Force-Reloading ldirectord" $DAEMON force-reload
;;
*)
echo "Usage: ldirectord
{start|stop|restart|try-restart|status|reload|force-reload}"
exit 1
esac
exit $?
|