]> git.pld-linux.org Git - packages/pacemaker.git/commitdiff
- PLD init script and systemd service file added
authorJacek Konieczny <jajcus@pld-linux.org>
Wed, 4 Jul 2012 19:58:44 +0000 (19:58 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- Release: 1.1

Changed files:
    pacemaker.init -> 1.1.2.1
    pacemaker.service -> 1.1.2.1
    pacemaker.spec -> 1.17.2.9

pacemaker.init [new file with mode: 0644]
pacemaker.service [new file with mode: 0644]
pacemaker.spec

diff --git a/pacemaker.init b/pacemaker.init
new file mode 100644 (file)
index 0000000..746230a
--- /dev/null
@@ -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
diff --git a/pacemaker.service b/pacemaker.service
new file mode 100644 (file)
index 0000000..e23f11c
--- /dev/null
@@ -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
index 5a0071aee210f444fb68c4e99019dd31a849733e..c2f6a2285d3b609789466949badc63c387b4c88a 100644 (file)
@@ -1,19 +1,18 @@
 #
-# 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
@@ -53,9 +52,9 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %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
@@ -138,7 +137,7 @@ Static Pacemaker libraries.
 
 %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
@@ -147,6 +146,8 @@ rm -r $RPM_BUILD_ROOT%{_docdir}/pacemaker
 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
This page took 0.046667 seconds and 4 git commands to generate.