]> git.pld-linux.org Git - packages/corosync.git/commitdiff
- systemd unit files added
authorJacek Konieczny <jajcus@pld-linux.org>
Wed, 4 Jul 2012 19:36:25 +0000 (19:36 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- corosync-notifyd init script updated - typos and 'sysconfig' file format
  compatible with systemd service
- Release: 2.2

Changed files:
    corosync-notifyd.init -> 1.1.2.1
    corosync-notifyd.service -> 1.1.2.1
    corosync-notifyd.sysconfig -> 1.1.2.1
    corosync.service -> 1.1.2.1
    corosync.spec -> 1.18.2.4
    corosync.target -> 1.1.2.1

corosync-notifyd.init
corosync-notifyd.service [new file with mode: 0644]
corosync-notifyd.sysconfig
corosync.service [new file with mode: 0644]
corosync.spec
corosync.target [new file with mode: 0644]

index ff08b48dc9b0888381f340ad2bc9061c3718b343..43c1eb9978d264ab9ecee7fa07d26f54ed21d4cb 100644 (file)
@@ -2,14 +2,14 @@
 #
 # 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.
@@ -19,9 +19,7 @@
 # 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
 
@@ -41,21 +39,8 @@ start() {
                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
 }
diff --git a/corosync-notifyd.service b/corosync-notifyd.service
new file mode 100644 (file)
index 0000000..8869aee
--- /dev/null
@@ -0,0 +1,16 @@
+[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
index c40c6dfc967efeb60bb0e4b7cf2b69b3349f2124..a4d4223a340d24118147ad6161ae9239b9a20c01 100644 (file)
@@ -1,12 +1,9 @@
 
-# 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"
diff --git a/corosync.service b/corosync.service
new file mode 100644 (file)
index 0000000..0b20105
--- /dev/null
@@ -0,0 +1,25 @@
+[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
index 0940660e8198e90c87a316b4e61af6fa1f896a57..4149f2a15219325910348b51abfb5a378373f346 100644 (file)
@@ -9,7 +9,7 @@ Summary:        Corosync - OSI Certified implementation of a complete cluster engine
 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
@@ -17,6 +17,9 @@ Source0:      ftp://ftp:downloads@corosync.org/downloads/%{name}-%{version}/%{name}-%
 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
@@ -120,7 +123,7 @@ Dane SNMP MIB dla Corosync.
 
 %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
@@ -131,11 +134,14 @@ sed -e 's/^/#/' $RPM_BUILD_ROOT%{_sysconfdir}/corosync/corosync.conf.example \
        >$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
@@ -147,6 +153,7 @@ 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
@@ -157,6 +164,7 @@ if [ "$1" = "0" ]; then
 fi
 %systemd_preun %{name}.service
 %systemd_preun %{name}-notifyd.service
+%systemd_preun %{name}.target
 
 %postun
 %systemd_reload
@@ -169,6 +177,9 @@ fi
 %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
diff --git a/corosync.target b/corosync.target
new file mode 100644 (file)
index 0000000..8728736
--- /dev/null
@@ -0,0 +1,5 @@
+[Unit]
+Description=Corosync Stack (bare or OpenAIS)
+
+[Install]
+WantedBy=multi-user.target
This page took 0.11587 seconds and 4 git commands to generate.