Accepting request 184593 from home:lisaseraph:branches:network:ha-clustering:Factory

submit patch to fix corosync start failed issue

OBS-URL: https://build.opensuse.org/request/show/184593
OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=32
This commit is contained in:
xia li 2013-07-30 06:50:18 +00:00 committed by Git OBS Bridge
parent e2a4aef80d
commit d3b44f80bd
3 changed files with 72 additions and 42 deletions

View File

@ -0,0 +1,20 @@
Index: corosync-2.3.1/init/corosync.in
===================================================================
--- corosync-2.3.1.orig/init/corosync.in
+++ corosync-2.3.1/init/corosync.in
@@ -29,6 +29,7 @@ PATH="/sbin:/bin:/usr/sbin:/usr/bin:@SBI
success()
{
echo -ne "[ OK ]\r"
+ rtrn=0
}
failure()
@@ -106,6 +107,7 @@ start()
# they also assume that init scripts will create
# required subdirectories for proper operations
mkdir -p @LOCALSTATEDIR@/run
+ mkdir -p @LOCALSTATEDIR@/lock/subsys
if status $prog > /dev/null 2>&1; then
success

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Jul 25 02:17:50 UTC 2013 - xli@suse.com
- Fix corosync start failed issue
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jul 23 09:44:07 UTC 2013 - xli@suse.com Tue Jul 23 09:44:07 UTC 2013 - xli@suse.com

View File

@ -24,7 +24,7 @@
%bcond_with monitoring %bcond_with monitoring
%bcond_with snmp %bcond_with snmp
%bcond_with rdma %bcond_with rdma
%bcond_with systemd %define with_systemd 1
%bcond_with upstart %bcond_with upstart
%bcond_with xmlconf %bcond_with xmlconf
%bcond_with runautogen %bcond_with runautogen
@ -47,12 +47,7 @@ Release: 0
Url: http://www.corosync.org Url: http://www.corosync.org
Source0: http://build.clusterlabs.org/%{name}/releases/%{name}-%{version}.tar.gz Source0: http://build.clusterlabs.org/%{name}/releases/%{name}-%{version}.tar.gz
Source2: baselibs.conf Source2: baselibs.conf
#Patch1: corosync-confexample-timestamp.patch Patch1: corosync-init-lockfile-path-error.patch
#Patch2: corosync-revert-cs2429.patch
#Patch4: corosync.conf.example.patch
#Patch5: corosync-cpg-procdown.patch
#Patch6: corosync_reduce_RR_priority.patch
#Patch7: fix-nodeid-conflicting.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
# Runtime bits # Runtime bits
Requires: libcorosync4 = %{version}-%{release} Requires: libcorosync4 = %{version}-%{release}
@ -79,25 +74,23 @@ BuildRequires: librdmacm-devel
%if %{with snmp} %if %{with snmp}
BuildRequires: net-snmp-devel BuildRequires: net-snmp-devel
%endif %endif
#%if %{with systemd} #%if %{with dbus}
BuildRequires: dbus-1-devel
#%endif
%if %{with_systemd}
#BuildRequires: systemd-devel #BuildRequires: systemd-devel
BuildRequires: systemd BuildRequires: systemd
#Requires(post): systemd Requires(post): systemd
#Requires(preun): systemd Requires(preun): systemd
#Requires(postun): systemd Requires(postun): systemd
#%endif %endif
%if %{with xmlconf} %if %{with xmlconf}
Requires: libxslt Requires: libxslt
%endif %endif
%prep %prep
%setup -q -n %{name}-%{version} %setup -q -n %{name}-%{version}
#%patch1 -p1 %patch1 -p1
#%patch2 -p1
#%patch4 -p1
#%patch5 -p1
#%patch6 -p1
#%patch7 -p1
%build %build
%if 0%{?buildtrunk} == 1 %if 0%{?buildtrunk} == 1
@ -126,6 +119,9 @@ export rdmacm_LIBS=-lrdmacm \
%if %{with rdma} %if %{with rdma}
--enable-rdma \ --enable-rdma \
%endif %endif
%if %{with_systemd}
--enable-systemd \
%endif
%if %{with upstart} %if %{with upstart}
--enable-upstart \ --enable-upstart \
%endif %endif
@ -134,13 +130,19 @@ export rdmacm_LIBS=-lrdmacm \
%endif %endif
--with-initddir=%{_initrddir} \ --with-initddir=%{_initrddir} \
--with-systemddir=%{_unitdir} \ --with-systemddir=%{_unitdir} \
--with-upstartdir=%{_sysconfdir}/init \ --with-upstartdir=%{_sysconfdir}/init
--enable-systemd # --enable-dbus \
#--enable-systemd
make %{_smp_mflags} make %{_smp_mflags}
%install %install
make install DESTDIR=%{buildroot} make install DESTDIR=%{buildroot}
%if %{with dbus}
mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
install -m 644 %{_builddir}/%{name}-%{version}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
%endif
# removed to discourage use of init.d/corosync (openais should be # removed to discourage use of init.d/corosync (openais should be
# used instead) # used instead)
#%if 0%{?suse_version} #%if 0%{?suse_version}
@ -176,35 +178,35 @@ default APIs and libraries, default configuration files, and an init
script. script.
%pre %pre
#%if %{with systemd} && 0%{?systemd_post:1} %if %{with_systemd} && 0%{?systemd_post:1}
%service_add_pre corosync.service corosync-notifyd.service %service_add_pre corosync.service corosync-notifyd.service
%endif
%post %post
#%if %{with systemd} && 0%{?systemd_post:1} %if %{with_systemd} && 0%{?systemd_post:1}
#%systemd_post corosync.service corosync-notifyd.service
%service_add_post corosync.service corosync-notifyd.service %service_add_post corosync.service corosync-notifyd.service
#%else %else
#if [ $1 -eq 1 ]; then if [ $1 -eq 1 ]; then
# /sbin/chkconfig --add corosync || : /sbin/chkconfig --add corosync || :
#fi fi
#%endif %endif
%preun %preun
#%if %{with systemd} && 0%{?systemd_preun:1} %if %{with_systemd} && 0%{?systemd_preun:1}
#%systemd_preun corosync.service corosync-notifyd.service #%systemd_preun corosync.service corosync-notifyd.service
%service_del_preun corosync.service corosync-notifyd.service %service_del_preun corosync.service corosync-notifyd.service
#%else %else
#if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
# /sbin/service corosync stop &>/dev/null || : /sbin/service corosync stop &>/dev/null || :
# /sbin/chkconfig --del corosync || : /sbin/chkconfig --del corosync || :
#fi fi
#%endif %endif
%postun %postun
#%if %{with systemd} && 0%{?systemd_postun:1} %if %{with_systemd} && 0%{?systemd_postun:1}
#%systemd_postun corosync.service corosync-notifyd.service #%systemd_postun corosync.service corosync-notifyd.service
%service_del_postun corosync.service corosync-notifyd.service %service_del_postun corosync.service corosync-notifyd.service
#%endif %endif
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
@ -231,19 +233,22 @@ script.
%config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
#%config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd #%config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
%config(noreplace) /usr/lib/tmpfiles.d/corosync-notifyd %config(noreplace) /usr/lib/tmpfiles.d/corosync-notifyd
%if %{with dbus}
%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
%endif
%if %{with snmp} %if %{with snmp}
%{_datadir}/snmp/mibs/COROSYNC-MIB.txt %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
%endif %endif
#%if %{with systemd} %if %{with_systemd}
%{_unitdir}/corosync.service %{_unitdir}/corosync.service
%{_unitdir}/corosync-notifyd.service %{_unitdir}/corosync-notifyd.service
%dir %{_datadir}/corosync %dir %{_datadir}/corosync
%{_datadir}/corosync/corosync %{_datadir}/corosync/corosync
%{_datadir}/corosync/corosync-notifyd %{_datadir}/corosync/corosync-notifyd
#%else %else
#%{_initrddir}/corosync %{_initrddir}/corosync
#%{_initrddir}/corosync-notifyd %{_initrddir}/corosync-notifyd
#%endif %endif
%if %{with upstart} %if %{with upstart}
%{_sysconfdir}/init/corosync.conf %{_sysconfdir}/init/corosync.conf
%{_sysconfdir}/init/corosync-notifyd.conf %{_sysconfdir}/init/corosync-notifyd.conf