packages (pacemaker-1_1): pacemaker/pacemaker.spec, pacemaker/pacemaker.ini...

jajcus jajcus at pld-linux.org
Wed Jul 4 21:58:49 CEST 2012


Author: jajcus                       Date: Wed Jul  4 19:58:49 2012 GMT
Module: packages                      Tag: pacemaker-1_1
---- Log message:
- PLD init script and systemd service file added
- Release: 1.1

---- Files affected:
packages/pacemaker:
   pacemaker.spec (1.17.2.8 -> 1.17.2.9) , pacemaker.init (NONE -> 1.1.2.1)  (NEW), pacemaker.service (NONE -> 1.1.2.1)  (NEW)

---- Diffs:

================================================================
Index: packages/pacemaker/pacemaker.spec
diff -u packages/pacemaker/pacemaker.spec:1.17.2.8 packages/pacemaker/pacemaker.spec:1.17.2.9
--- packages/pacemaker/pacemaker.spec:1.17.2.8	Wed Jul  4 21:42:50 2012
+++ packages/pacemaker/pacemaker.spec	Wed Jul  4 21:58:44 2012
@@ -1,20 +1,19 @@
 # $Revision$, $Date$
 #
-# TODO:
-#	- optional support for complete openais stack (corosync is often enough)
-
 %bcond_without	corosync	# build with corosync stack
 %bcond_without	heartbeat	# build without heartbeat stack
 Summary:	The scalable High-Availability cluster resource manager
 Name:		pacemaker
 Version:	1.1.7
-Release:	1
+Release:	1.1
 License:	GPL v2+; LGPL v2.1+
 Group:		Applications/System
 # https://github.com/ClusterLabs/pacemaker/tarball/Pacemaker-%{version}
 Source0:	ClusterLabs-pacemaker-Pacemaker-%{version}-0-gee0730e.tar.gz
 # Source0-md5:	61076a946cf2ba549dce1458e2ef76e2
 Source1:	%{name}.tmpfiles
+Source2:	%{name}.init
+Source3:	%{name}.service
 Patch0:		%{name}-ncurses.patch
 Patch1:		%{name}-libs.patch
 Patch2:		%{name}-awk.patch
@@ -54,9 +53,9 @@
 %define skip_post_check_so libpe_status.so.*
 
 %description
-Pacemaker makes use of your cluster infrastructure (either OpenAIS or
-Heartbeat) to stop, start and monitor the health of the services (aka.
-resources) you want the cluster to provide.
+Pacemaker makes use of your cluster infrastructure (either 
+Corosync/OpenAIS or Heartbeat) to stop, start and monitor the health
+of the services (aka.  resources) you want the cluster to provide.
 
 It can do this for clusters of practically any size and comes with a
 powerful dependency model that allows the administrator to accurately
@@ -139,7 +138,7 @@
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/usr/lib/tmpfiles.d,/etc/rc.d}
+install -d $RPM_BUILD_ROOT{/usr/lib/tmpfiles.d,/etc/rc.d/init.d,%{systemdunitdir}}
 
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
@@ -148,6 +147,8 @@
 rm $RPM_BUILD_ROOT%{_libdir}/heartbeat/plugins/RAExec/*.{la,a}
 
 install %{SOURCE1} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/%{name}.conf
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -281,6 +282,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.17.2.9  2012/07/04 19:58:44  jajcus
+- PLD init script and systemd service file added
+- Release: 1.1
+
 Revision 1.17.2.8  2012/07/04 19:42:50  jajcus
 - /lib/heartbeat/crm directory is needed by Pacemaker even without heartbeat
 

================================================================
Index: packages/pacemaker/pacemaker.init
diff -u /dev/null packages/pacemaker/pacemaker.init:1.1.2.1
--- /dev/null	Wed Jul  4 21:58:49 2012
+++ packages/pacemaker/pacemaker.init	Wed Jul  4 21:58:44 2012
@@ -0,0 +1,92 @@
+#!/bin/sh
+#
+# pacemaker	Pacemaker Cluster Manager for the Corosync stack
+#
+# chkconfig: 2345 23 77
+# description: Pacemaker Cluster Manager
+# processname: pacemakerd
+#
+### BEGIN INIT INFO
+# Provides:		pacemaker
+# Required-Start:	$corosync
+# Required-Stop:	$corosync
+# Default-Start:
+# Default-Stop:
+# Short-Description:	Starts and stops Pacemaker Cluster Manager.
+# Description:		Starts and stops Pacemaker Cluster Manager.
+### END INIT INFO
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+[ -f /etc/sysconfig/pacemaker ] && . /etc/sysconfig/pacemaker
+
+start() {
+	# Check if the service is already running?
+	if [ -f /var/lock/subsys/pacemaker ]; then
+		msg_already_running "Pacemaker Cluster Manager"
+		return
+	fi
+	if grep -q nocluster /proc/cmdline ; then
+		show "Disabled on boot"
+		RETVAL=1
+		return
+	fi
+
+	msg_starting "Pacemaker Cluster Manager"
+	daemon /usr/sbin/pacemakerd --pid-file=/var/run/pacemakerd.pid
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pacemaker
+}
+
+stop() {
+	if [ ! -f /var/lock/subsys/pacemaker ]; then
+		msg_not_running "Pacemaker Cluster Manager"
+		return
+	fi
+
+	# Stop daemons.
+	msg_stopping "Pacemaker Cluster Manager"
+	killproc /usr/sbin/pacemakerd
+	rm -f /var/lock/subsys/pacemaker
+}
+
+condrestart() {
+	if [ ! -f /var/lock/subsys/pacemaker ]; then
+		msg_not_running "Pacemaker Cluster Manager"
+		RETVAL=$1
+		return
+	fi
+
+	stop
+	start
+}
+
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart)
+	stop
+   	sleep 5
+	start
+	;;
+  try-restart)
+	condrestart 0
+	;;
+  force-reload)
+	condrestart 7
+	;;
+  status)
+	status pacemaker pacemakerd
+	RETVAL=$?
+	;;
+*)
+	msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+	exit 3
+	;;
+esac
+exit $RETVAL

================================================================
Index: packages/pacemaker/pacemaker.service
diff -u /dev/null packages/pacemaker/pacemaker.service:1.1.2.1
--- /dev/null	Wed Jul  4 21:58:49 2012
+++ packages/pacemaker/pacemaker.service	Wed Jul  4 21:58:44 2012
@@ -0,0 +1,23 @@
+[Unit]
+Description=Pacemaker High Availability Cluster Manager for Corosync stack
+
+After=corosync.target
+Requires=corosync.target
+
+[Install]
+WantedBy=multi-user.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/pacemakerd.pid
+KillMode=process
+SysVStartPriority=23
+EnvironmentFile=-/etc/sysconfig/pacemaker
+ExecStart=/usr/sbin/pacemakerd --pid-file=/var/run/pacemakerd.pid
+
+# Pacemaker can only exit after all managed services have shut down
+# A HA database could conceivably take even longer than this 
+TimeoutSec=30min
+
+# Restart options include: no, on-success, on-failure, on-abort or always
+Restart=on-failure
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/packages/pacemaker/pacemaker.spec?r1=1.17.2.8&r2=1.17.2.9



More information about the pld-cvs-commit mailing list