diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2011-11-03 15:44:06 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2011-11-03 15:44:06 +0000 |
commit | 49c8fbfcc3dcd2482e77d619a9bb3fa7273d1e07 (patch) | |
tree | bdce4e074527c04bfb569668e1209a53f9561702 /testing/pacemaker/pacemaker.initd | |
parent | 5d145f8451e3a7294be5561ea786e977b5144a9e (diff) | |
download | aports-49c8fbfcc3dcd2482e77d619a9bb3fa7273d1e07.tar.bz2 aports-49c8fbfcc3dcd2482e77d619a9bb3fa7273d1e07.tar.xz |
testing/pacemaker: add missing initd
Diffstat (limited to 'testing/pacemaker/pacemaker.initd')
-rw-r--r-- | testing/pacemaker/pacemaker.initd | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/testing/pacemaker/pacemaker.initd b/testing/pacemaker/pacemaker.initd new file mode 100644 index 0000000000..4231425f88 --- /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 $? +} |