Author: jajcus Date: Tue Jul 3 21:24:28 2012 GMT Module: packages Tag: corosync-1_4 ---- Log message: PLD init scripts added
---- Files affected: packages/corosync: corosync.spec (1.18.2.2 -> 1.18.2.3) , corosync-notifyd.init (NONE -> 1.1) (NEW), corosync-notifyd.sysconfig (NONE -> 1.1) (NEW), corosync.init (NONE -> 1.1) (NEW) ---- Diffs: ================================================================ Index: packages/corosync/corosync.spec diff -u packages/corosync/corosync.spec:1.18.2.2 packages/corosync/corosync.spec:1.18.2.3 --- packages/corosync/corosync.spec:1.18.2.2 Sun Jul 1 16:52:34 2012 +++ packages/corosync/corosync.spec Tue Jul 3 23:24:22 2012 @@ -10,11 +10,14 @@ Summary(pl.UTF-8): Corosync - implementacja silnika klastrowego certyfikowana przez OSI Name: corosync Version: 1.4.3 -Release: 2 +Release: 2.1 License: BSD Group: Base Source0: ftp://ftp:[email protected]/downloads/%{name}-%{version}/%{name}-%{version}.tar.gz # Source0-md5: 9e9943a7d9eb90fabd52d12b215c699c +Source1: %{name}.init +Source2: %{name}-notifyd.init +Source3: %{name}-notifyd.sysconfig Patch0: %{name}-makefile.patch URL: http://www.corosync.org/ BuildRequires: autoconf >= 2.61 @@ -118,6 +121,7 @@ %install rm -rf $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/sysconfig} %{__make} install \ DESTDIR=$RPM_BUILD_ROOT @@ -128,11 +132,36 @@ >$RPM_BUILD_ROOT%{_sysconfdir}/corosync/corosync.conf %{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/corosync/corosync.conf.example* +install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} +install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-notifyd +install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/%{name}-notifyd + %{?with_apidocs:install doc/api/man/man3/* $RPM_BUILD_ROOT%{_mandir}/man3} %clean rm -rf $RPM_BUILD_ROOT +%post +/sbin/chkconfig --add %{name} +/sbin/chkconfig --add %{name}-notifyd +%service %{name} restart +%service %{name}-notifyd restart +%systemd_post %{name}.service +%systemd_post %{name}-notifyd.service + +%preun +if [ "$1" = "0" ]; then + %service -q %{name} stop + /sbin/chkconfig --del %{name} + %service -q %{name}-notifyd stop + /sbin/chkconfig --del %{name}-notifyd +fi +%systemd_preun %{name}.service +%systemd_preun %{name}-notifyd.service + +%postun +%systemd_reload + %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig @@ -141,6 +170,7 @@ %doc AUTHORS ChangeLog LICENSE README.devmap README.recovery SECURITY TODO conf/corosync.conf.example* %attr(754,root,root) /etc/rc.d/init.d/corosync %attr(754,root,root) /etc/rc.d/init.d/corosync-notifyd +%verify(not md5 mtime size) %config(noreplace) /etc/sysconfig/%{name}-notifyd %dir %{_sysconfdir}/corosync %verify(not md5 mtime size) %config(noreplace) %{_sysconfdir}/corosync/corosync.conf %attr(755,root,root) %{_bindir}/corosync-blackbox @@ -266,6 +296,9 @@ All persons listed below can be reached at <cvs_login>@pld-linux.org $Log$ +Revision 1.18.2.3 2012/07/03 21:24:22 jajcus +PLD init scripts added + Revision 1.18.2.2 2012/07/01 14:52:34 jajcus - package /var/lib/corosync dir, corosync won't start without it - Release: 2 ================================================================ Index: packages/corosync/corosync-notifyd.init diff -u /dev/null packages/corosync/corosync-notifyd.init:1.1 --- /dev/null Tue Jul 3 23:24:28 2012 +++ packages/corosync/corosync-notifyd.init Tue Jul 3 23:24:22 2012 @@ -0,0 +1,113 @@ +#!/bin/sh +# +# corosync-notifyd Corosync Dbus and snmp notifier +# +# chkconfig: 2345 23 77 +# description: Corosync Dbus and snmp notifier +# processname: corosync-notifyd-notifyd +# +### BEGIN INIT INFO +# Provides: corosync-notifyd-notifyd +# Required-Start: $corosync-notifyd $cman +# Required-Stop: $corosync-notifyd $cman +# Default-Start: +# Default-Stop: +# Short-Description: Starts and stops Corosync Notifier. +# Description: Starts and stops Corosync Notifier. +### END INIT INFO + +# Source function library +. /etc/rc.d/init.d/functions + +SEND_SNMP_TRAPS=no +SEND_DBUS_SIGNALS=yes +LOG_ALL_EVENTS=no + +[ -f /etc/sysconfig/corosync-notifyd ] && . /etc/sysconfig/corosync-notifyd + +start() { + # Check if the service is already running? + if [ -f /var/lock/subsys/corosync-notifyd ]; then + msg_already_running "Corosync Notifier" + return + fi + if [ -f /var/lock/subsys/openais ]; then + msg_already_running "Corosync Notifier (as openais)" + return + fi + if grep -q nocluster /proc/cmdline ; then + show "Disabled on boot" + RETVAL=1 + return + fi + + local options="" + if is_yes "$SEND_SNMP_TRAPS" ; then + options="$options -s" + fi + if [ -n "$SNMP_MANAGER" ] ; then + options="$options -m $SNMP_MANAGER" + fi + if is_yes "$SEND_DBUS_SIGNALS" ; then + options="$options -d" + fi + if is_yes "$LOG_ALL_EVENTS" ; then + options="$options -l" + fi + msg_starting "Corosync Notifier" + daemon /usr/sbin/corosync-notifyd "$options" + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/corosync-notifyd +} + +stop() { + if [ ! -f /var/lock/subsys/corosync-notifyd ]; then + msg_not_running "Corosync Notifier" + return + fi + + # Stop daemons. + msg_stopping "Corosync Notifier" + killproc /usr/sbin/corosync-notifyd + rm -f /var/lock/subsys/corosync-notifyd +} + +condrestart() { + if [ ! -f /var/lock/subsys/corosync-notifyd ]; then + msg_not_running "Corosync Notifier" + 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 corosync-notifyd + RETVAL=$? + ;; +*) + msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" + exit 3 + ;; +esac +exit $RETVAL ================================================================ Index: packages/corosync/corosync-notifyd.sysconfig diff -u /dev/null packages/corosync/corosync-notifyd.sysconfig:1.1 --- /dev/null Tue Jul 3 23:24:28 2012 +++ packages/corosync/corosync-notifyd.sysconfig Tue Jul 3 23:24:22 2012 @@ -0,0 +1,12 @@ + +# Send SNMP traps on all events. +SEND_SNMP_TRAPS=no + +# SNMP Manager IP address (defaults to localhost). +#SNMP_MANAGER= + +# Send DBUS signals on all events. +SEND_DBUS_SIGNALS=yes + +# Log all events. +LOG_ALL_EVENTS=no ================================================================ Index: packages/corosync/corosync.init diff -u /dev/null packages/corosync/corosync.init:1.1 --- /dev/null Tue Jul 3 23:24:28 2012 +++ packages/corosync/corosync.init Tue Jul 3 23:24:22 2012 @@ -0,0 +1,96 @@ +#!/bin/sh +# +# corosync Corosync Cluster Engine +# +# chkconfig: 2345 21 79 +# description: Corosync Cluster Engine +# processname: corosync +# +### BEGIN INIT INFO +# Provides: corosync +# Required-Start: $network $syslog +# Required-Stop: $network $syslog +# Default-Start: +# Default-Stop: +# Short-Description: Starts and stops Corosync Cluster Engine. +# Description: Starts and stops Corosync Cluster Engine. +### END INIT INFO + +# Source function library +. /etc/rc.d/init.d/functions + +[ -f /etc/sysconfig/corosync ] && . /etc/sysconfig/corosync + +start() { + # Check if the service is already running? + if [ -f /var/lock/subsys/corosync ]; then + msg_already_running "Corosync Cluster Engine" + return + fi + if [ -f /var/lock/subsys/openais ]; then + msg_already_running "Corosync Cluster Engine (as openais)" + return + fi + if grep -q nocluster /proc/cmdline ; then + show "Disabled on boot" + RETVAL=1 + return + fi + + msg_starting "Corosync Cluster Engine" + daemon /usr/sbin/corosync + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/corosync +} + +stop() { + if [ ! -f /var/lock/subsys/corosync ]; then + msg_not_running "Corosync Cluster Engine" + return + fi + + # Stop daemons. + msg_stopping "Corosync Cluster Engine" + killproc /usr/sbin/corosync + rm -f /var/lock/subsys/corosync +} + +condrestart() { + if [ ! -f /var/lock/subsys/corosync ]; then + msg_not_running "Corosync Cluster Engine" + 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 corosync + RETVAL=$? + ;; +*) + msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" + exit 3 + ;; +esac +exit $RETVAL ================================================================ ---- CVS-web: http://cvs.pld-linux.org/packages/corosync/corosync.spec?r1=1.18.2.2&r2=1.18.2.3 _______________________________________________ pld-cvs-commit mailing list [email protected] http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
