summaryrefslogtreecommitdiffstats
path: root/testing/pacemaker/pacemaker.initd
diff options
context:
space:
mode:
authorFabian Affolter <fabian@affolter-engineering.ch>2011-12-10 10:15:38 +0000
committerFabian Affolter <fabian@affolter-engineering.ch>2011-12-10 10:15:38 +0000
commitca512d5d5d8df5cbacfb9e0b1cdc1f45ae89149b (patch)
tree38834d5f27c903ae902e897550053b499c26151d /testing/pacemaker/pacemaker.initd
parent51f554c054599d345525bd9d816eb3009fb80cc4 (diff)
parent4fb67906a83bf64c28da07340367614cc32d0245 (diff)
downloadaports-ca512d5d5d8df5cbacfb9e0b1cdc1f45ae89149b.tar.bz2
aports-ca512d5d5d8df5cbacfb9e0b1cdc1f45ae89149b.tar.xz
Merge branch 'master' of git://git.alpinelinux.org/aports
Diffstat (limited to 'testing/pacemaker/pacemaker.initd')
-rw-r--r--testing/pacemaker/pacemaker.initd39
1 files changed, 39 insertions, 0 deletions
diff --git a/testing/pacemaker/pacemaker.initd b/testing/pacemaker/pacemaker.initd
new file mode 100644
index 000000000..4231425f8
--- /dev/null
+++ b/testing/pacemaker/pacemaker.initd
@@ -0,0 +1,39 @@
+#!/sbin/runscript
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-cluster/pacemaker/files/pacemaker.initd,v 1.1 2011/02/21 14:39:28 ultrabug Exp $
+
+PIDFILE=/var/run/pacemaker.pid
+
+depend() {
+ need net corosync
+ use syslog
+}
+
+start() {
+ nc=0
+ ebegin "Starting Pacemaker Cluster Manager"
+ einfon "Waiting for Corosync startup ."
+ while true; do
+ /usr/sbin/corosync-cfgtool -s &>/dev/null && break
+ nc=$(expr $nc + 1)
+ if [ $nc -gt 30 ]; then
+ echo
+ eend 1 "Failed to detect Corosync startup, is it really running ?"
+ exit 1
+ fi
+ sleep 1
+ echo -n "."
+ done
+ echo
+ start-stop-daemon --start -q --exec /usr/sbin/pacemakerd \
+ --pidfile "${PIDFILE}" --make-pidfile --background \
+ -- -f
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Pacemaker Cluster Manager"
+ start-stop-daemon --stop -q --pidfile "${PIDFILE}"
+ eend $?
+}