forked from signal18/replication-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreplication-manager-arm.init.el6
executable file
·68 lines (64 loc) · 1.65 KB
/
replication-manager-arm.init.el6
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
#!/bin/sh
# replication-manager Replication HA Management for MariaDB 10.x
#
# chkconfig: - 90 10
# description: replication-manager
# processname: replication-manager
# config: /etc/replication-manager/config.toml
### BEGIN INIT INFO
# Provides: replication-manager
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts replication-manager
# Description: starts the MariaDB/MySQL replication-manager service
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
RETVAL=0
PROCNAME=replication-manager-arm
# See how we were called.
case "$1" in
start)
echo -n "Starting replication-manager arm: "
/usr/bin/replication-manager-arm monitor > /dev/null 2>&1 &
sleep 1
pkill -0 -f "/usr/bin/replication-manager-arm monitor"
RETVAL=$?
if [ $RETVAL -eq 0 ]
then
echo_success
touch /var/lock/subsys/replication-manager
else
echo_failure
fi
echo
;;
stop)
echo -n "Stopping replication-manager armimal: "
kill $(pidof replication-manager-arm)
RETVAL=$?
if [ $RETVAL -eq 0 ]
then
echo_success
rm -f /var/lock/subsys/replication-manager
else
echo_failure
fi
echo
;;
status)
status $PROCNAME
RETVAL=$?
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
;;
*)
echo "Usage: replication-manager {start|stop|status|restart}"
exit 1
esac
exit $RETVAL