/etc/init.d/pacemaker_remote is in pacemaker-remote 1.1.16-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | #!/bin/bash
# Authors:
# Andrew Beekhof <abeekhof@redhat.com>
#
# License: Revised BSD
# chkconfig: - 99 01
# description: Pacemaker Cluster Manager
# processname: pacemaker_remoted
#
### BEGIN INIT INFO
# Provides: pacemaker_remote
# Required-Start: $network $remote_fs
# Should-Start: $syslog
# Required-Stop: $network $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts and stops the Pacemaker remote agent for non-cluster nodes
# Description: Starts and stops the Pacemaker remote agent for non-cluster nodes
### END INIT INFO
# The systemd package provides /lib/lsb/init-functions.d/40-systemd
# to redirect /etc/init.d/$script calls to systemctl. (Thanks: Lintian.)
. /lib/lsb/init-functions
desc="Pacemaker Remote Agent"
prog="pacemaker_remoted"
cman=0
# set secure PATH
PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/sbin"
checkrc() {
if [ $? = 0 ]; then
success
else
failure
fi
}
success()
{
echo -ne "[ OK ]\r"
}
failure()
{
echo -ne "[FAILED]\r"
}
status()
{
pid=$(pidof $1 2>/dev/null)
local rtrn=$?
if [ $rtrn -ne 0 ]; then
echo "$1 is stopped"
if [ -f "/var/run/$prog.pid" ]; then
rtrn=1
else
rtrn=3
fi
else
echo "$1 (pid $pid) is running..."
fi
return $rtrn
}
if [ -d /etc/default ]; then
[ -f /etc/init.d/functions ] && . /etc/init.d/functions
set -a
[ -f /etc/default/pacemaker ] && . /etc/default/pacemaker
[ -f /etc/default/sbd ] && . /etc/default/sbd
set +a
fi
LOCK_DIR="."
if [ -d "/var/lock/subsys" ]; then
LOCK_DIR="/var/lock/subsys"
elif [ -d "/var/lock" ]; then
LOCK_DIR="/var/lock"
fi
[ -z "$LOCK_FILE" ] && LOCK_FILE="$LOCK_DIR/pacemaker_remote"
# Check if there is a valid watchdog-device configured in sbd config
if [ x != "x$SBD_WATCHDOG_DEV" -a "/dev/null" != "$SBD_WATCHDOG_DEV" -a -c "$SBD_WATCHDOG_DEV" ]; then
# enhance for unavailable chkconfig - don't touch sbd for now
if chkconfig --list sbd_remote_helper 2>/dev/null | grep -q ":on"; then
SBD_SERVICE=sbd_remote_helper
fi
fi
start()
{
echo -n "Starting $desc: "
# most recent distributions use tmpfs for $/var/run
# to avoid to clean it up on every boot.
# they also assume that init scripts will create
# required subdirectories for proper operations
mkdir -p "/var/run"
if status $prog > /dev/null 2>&1; then
success
else
$prog > /dev/null 2>&1 &
# Time to connect to corosync and fail
sleep 5
if status $prog > /dev/null 2>&1; then
touch "$LOCK_FILE"
pidof $prog > "/var/run/$prog.pid"
success
else
failure
rtrn=1
fi
fi
echo
[ "x$SBD_SERVICE" = "x" ] || service $SBD_SERVICE start
}
stop()
{
if status $prog > /dev/null 2>&1; then
echo -n "Signaling $desc to terminate: "
kill -TERM $(pidof $prog) > /dev/null 2>&1
success
echo
echo -n "Waiting for $desc to unload:"
while status $prog > /dev/null 2>&1; do
sleep 1
echo -n "."
done
else
echo -n "$desc is already stopped"
fi
rm -f "$LOCK_FILE"
rm -f "/var/run/$prog.pid"
success
echo
[ "x$SBD_SERVICE" = "x" ] || service $SBD_SERVICE stop
}
rtrn=0
case "$1" in
start)
start
;;
restart|reload|force-reload)
stop
start
;;
condrestart|try-restart)
if status $prog > /dev/null 2>&1; then
stop
start
rtrn=$?
fi
;;
status)
status $prog
rtrn=$?
;;
stop)
stop
rtrn=$?
;;
*)
echo "usage: $0 {start|stop|restart|reload|force-reload|condrestart|try-restart|status}"
rtrn=2
;;
esac
exit $rtrn
|