#
# corosync-notifyd Corosync Dbus and snmp notifier
#
-# chkconfig: 2345 23 77
+# chkconfig: 2345 22 78
# description: Corosync Dbus and snmp notifier
-# processname: corosync-notifyd-notifyd
+# processname: corosync-notifyd
#
### BEGIN INIT INFO
-# Provides: corosync-notifyd-notifyd
-# Required-Start: $corosync-notifyd $cman
-# Required-Stop: $corosync-notifyd $cman
+# Provides: corosync-notifyd
+# Required-Start: $corosync $cman
+# Required-Stop: $corosync $cman
# Default-Start:
# Default-Stop:
# Short-Description: Starts and stops Corosync Notifier.
# Source function library
. /etc/rc.d/init.d/functions
-SEND_SNMP_TRAPS=no
-SEND_DBUS_SIGNALS=yes
-LOG_ALL_EVENTS=no
+COROSYNC_NOTIFYD_OPTS="-d"
[ -f /etc/sysconfig/corosync-notifyd ] && . /etc/sysconfig/corosync-notifyd
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"
+ daemon /usr/sbin/corosync-notifyd $COROSYNC_NOTIFYD_OPTS
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/corosync-notifyd
}
--- /dev/null
+[Unit]
+Description=Corosync Dbus and SNMP notifier
+After=openais.service
+After=corosync.service
+
+[Install]
+WantedBy=corosync.target
+
+[Service]
+Type=simple
+KillMode=process
+SysVStartPriority=22
+Environment=COROSYNC_NOTIFYD_OPTS=-d
+EnvironmentFile=-/etc/sysconfig/corosync-notifyd
+ExecStart=/usr/sbin/corosync-notifyd -f $COROSYNC_NOTIFYD_OPTS
+Restart=on-failure
-# 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
+# corosync-notifyd options
+#
+# -l : Log all events.
+# -s : Send SNMP traps on all events.
+# -m : SNMP Manager IP address (defaults to localhost).
+# -d : Send DBUS signals on all events.
+#
+COROSYNC_NOTIFYD_OPTS="-d"
--- /dev/null
+[Unit]
+Description=Corosync Cluster Engine
+ConditionKernelCommandLine=!nocluster
+Requires=network.target
+After=network.target
+Names=corosync-stack.service
+Conflicts=openais.service
+
+[Install]
+WantedBy=corosync.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/corosync.pid
+KillMode=process
+SysVStartPriority=21
+EnvironmentFile=-/etc/sysconfig/corosync
+ExecStart=/usr/sbin/corosync
+
+# 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
Summary(pl.UTF-8): Corosync - implementacja silnika klastrowego certyfikowana przez OSI
Name: corosync
Version: 1.4.3
-Release: 2.1
+Release: 2.2
License: BSD
Group: Base
Source0: ftp://ftp:downloads@corosync.org/downloads/%{name}-%{version}/%{name}-%{version}.tar.gz
Source1: %{name}.init
Source2: %{name}-notifyd.init
Source3: %{name}-notifyd.sysconfig
+Source4: %{name}.service
+Source5: %{name}-notifyd.service
+Source6: %{name}.target
Patch0: %{name}-makefile.patch
URL: http://www.corosync.org/
BuildRequires: autoconf >= 2.61
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/sysconfig}
+install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,/etc/sysconfig,%{systemdunitdir}}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
>$RPM_BUILD_ROOT%{_sysconfdir}/corosync/corosync.conf
%{__rm} $RPM_BUILD_ROOT%{_sysconfdir}/corosync/corosync.conf.example*
+%{?with_apidocs:install doc/api/man/man3/* $RPM_BUILD_ROOT%{_mandir}/man3}
+
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}
+install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service
+install %{SOURCE5} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-notifyd.service
+install %{SOURCE6} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.target
%clean
rm -rf $RPM_BUILD_ROOT
%service %{name}-notifyd restart
%systemd_post %{name}.service
%systemd_post %{name}-notifyd.service
+%systemd_post %{name}.target
%preun
if [ "$1" = "0" ]; then
fi
%systemd_preun %{name}.service
%systemd_preun %{name}-notifyd.service
+%systemd_preun %{name}.target
%postun
%systemd_reload
%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
+%{systemdunitdir}/%{name}.service
+%{systemdunitdir}/%{name}-notifyd.service
+%{systemdunitdir}/%{name}.target
%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
--- /dev/null
+[Unit]
+Description=Corosync Stack (bare or OpenAIS)
+
+[Install]
+WantedBy=multi-user.target