From da8f6162fc7af6ef17c8b4e761a7d3e47336c1e1bad4726a264d2918c41a51fb Mon Sep 17 00:00:00 2001 From: Yuan Ren Date: Thu, 7 Nov 2019 11:52:11 +0000 Subject: [PATCH 1/2] Accepting request 746240 from home:yuanren10 Fix some noisy output during installation and sysconfig file issues OBS-URL: https://build.opensuse.org/request/show/746240 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=161 --- corosync.changes | 7 +++++++ corosync.spec | 36 ++++++++++++++++++++++-------------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/corosync.changes b/corosync.changes index 794bef6..a728a51 100644 --- a/corosync.changes +++ b/corosync.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Nov 7 06:26:20 UTC 2019 - Yuan Ren + +- Packaging bug updating Corosync(bsc#1155792) + Some noisy output from Tumbleweed caused by RPM macro not fairly used + Make sure corosync sysconfig keep original configured firstly(bsc1153502) + ------------------------------------------------------------------- Wed Oct 9 07:55:48 UTC 2019 - Yuan Ren diff --git a/corosync.spec b/corosync.spec index 0ba5548..39cbacf 100644 --- a/corosync.spec +++ b/corosync.spec @@ -257,7 +257,10 @@ APIs and libraries, default configuration files, and an init script. %post /usr/lib/corosync/upgrade.sh %tmpfiles_create /usr/lib/tmpfiles.d/corosync-notifyd -%{fillup_and_insserv -n corosync} +%{fillup_only -n corosync} +# restore configured /etc/sysconfig/corosync(bsc#1155792) +mv /etc/sysconfig/corosync /etc/sysconfig/corosynctmp + %service_add_post corosync.service corosync-notifyd.service rm -rf %{_sysconfdir}/corosync/corosync.conf.example %{_sysconfdir}/corosync/corosync.conf.example.unicast @@ -267,9 +270,9 @@ ln -s /usr/share/doc/packages/corosync/corosync.conf.example.udpu %{_sysconfdir} %preun %service_del_preun corosync.service corosync-notifyd.service -%postun -if [ -f /etc/sysconfig/corosync ]; then - rm /etc/sysconfig/corosync +%posttrans -n corosync +if [ ! -f /etc/sysconfig/corosync ] ; then + mv /etc/sysconfig/corosynctmp /etc/sysconfig/corosync fi %files @@ -571,7 +574,9 @@ NSS certificates and an init script. %service_add_pre corosync-qdevice.service %post -n corosync-qdevice -%{fillup_and_insserv -n corosync-qdevice} +%{fillup_only -n corosync-qdevice} +mv /etc/sysconfig/corosync-qdevice /etc/sysconfig/corosync-qdevicetmp + %if %{sles_version} > 0 ln -s /run/corosync-qdevice /var/run/ %endif @@ -584,12 +589,13 @@ ln -s /run/corosync-qdevice /var/run/ unlink /var/run/corosync-qdevice %endif -%postun -n corosync-qdevice -if [ -f /etc/sysconfig/corosync-qdevice ]; then - rm /etc/sysconfig/corosync-qdevice -fi %service_del_postun corosync-qdevice.service +%posttrans -n corosync-qdevice +if [ ! -f /etc/sysconfig/corosync-qdevice ] ; then + mv /etc/sysconfig/corosync-qdevicetmp /etc/sysconfig/corosync-qdevice +fi + %files -n corosync-qdevice %defattr(-,root,root,-) %dir %{_sysconfdir}/corosync/qdevice @@ -641,7 +647,8 @@ exit 0 %if %{sles_version} > 0 ln -s /run/corosync-qnetd /var/run/ %endif -%{fillup_and_insserv -n corosync-qnetd} +%{fillup_only -n corosync-qnetd} +mv /etc/sysconfig/corosync-qnetd /etc/sysconfig/corosync-qnetdtmp %service_add_post corosync-qnetd.service @@ -652,12 +659,13 @@ ln -s /run/corosync-qnetd /var/run/ unlink /var/run/corosync-qnetd %endif -%postun -n corosync-qnetd -if [ -f /etc/sysconfig/corosync-qnetd ];then - rm /etc/sysconfig/corosync-qnetd -fi %service_del_postun corosync-qnetd.service +%posttrans -n corosync-qnetd +if [ ! -f /etc/sysconfig/corosync-qnetd ] ; then + mv /etc/sysconfig/corosync-qnetdtmp /etc/sysconfig/corosync-qnetd +fi + %files -n corosync-qnetd %defattr(-,root,root,-) %dir %config(noreplace) %attr(750, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd From 3b4a9d7d25319841992dcf37c4be3f4d184b8b8e4ce028b76d66abf50f020336 Mon Sep 17 00:00:00 2001 From: Yuan Ren Date: Mon, 11 Nov 2019 07:28:06 +0000 Subject: [PATCH 2/2] Accepting request 746530 from home:yuanren10 fix corosync upgrade problem OBS-URL: https://build.opensuse.org/request/show/746530 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/corosync?expand=0&rev=162 --- corosync.spec | 47 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/corosync.spec b/corosync.spec index 39cbacf..c3d339c 100644 --- a/corosync.spec +++ b/corosync.spec @@ -256,10 +256,12 @@ APIs and libraries, default configuration files, and an init script. %post /usr/lib/corosync/upgrade.sh -%tmpfiles_create /usr/lib/tmpfiles.d/corosync-notifyd %{fillup_only -n corosync} -# restore configured /etc/sysconfig/corosync(bsc#1155792) -mv /etc/sysconfig/corosync /etc/sysconfig/corosynctmp +# Upgrade +if [ $1 -eq 2 ] ; then + # restore configured /etc/sysconfig/corosync(bsc#1155792) + install -m 0644 %{_sysconfdir}/sysconfig/corosync /tmp/.sysconfig.corosync +fi %service_add_post corosync.service corosync-notifyd.service @@ -270,9 +272,14 @@ ln -s /usr/share/doc/packages/corosync/corosync.conf.example.udpu %{_sysconfdir} %preun %service_del_preun corosync.service corosync-notifyd.service -%posttrans -n corosync -if [ ! -f /etc/sysconfig/corosync ] ; then - mv /etc/sysconfig/corosynctmp /etc/sysconfig/corosync +%postun +if [ -f %{_sysconfdir}/sysconfig/corosync ]; then + rm %{_sysconfdir}/sysconfig/corosync +fi + +%posttrans +if [ ! -f %{_sysconfdir}/sysconfig/corosync ] ; then + install -m 0644 /tmp/.sysconfig.corosync %{_sysconfdir}/sysconfig/corosync fi %files @@ -575,7 +582,10 @@ NSS certificates and an init script. %post -n corosync-qdevice %{fillup_only -n corosync-qdevice} -mv /etc/sysconfig/corosync-qdevice /etc/sysconfig/corosync-qdevicetmp +# Upgrade +if [ $1 -eq 2 ] ; then + install -m 0644 %{_sysconfdir}/sysconfig/corosync-qdevice /tmp/.sysconfig.corosync-qdevice +fi %if %{sles_version} > 0 ln -s /run/corosync-qdevice /var/run/ @@ -591,9 +601,14 @@ unlink /var/run/corosync-qdevice %service_del_postun corosync-qdevice.service +%postun -n corosync-qdevice +if [ -f %{_sysconfdir}/sysconfig/corosync-qdevice ]; then + rm %{_sysconfdir}/sysconfig/corosync-qdevice +fi + %posttrans -n corosync-qdevice -if [ ! -f /etc/sysconfig/corosync-qdevice ] ; then - mv /etc/sysconfig/corosync-qdevicetmp /etc/sysconfig/corosync-qdevice +if [ ! -f %{_sysconfdir}/sysconfig/corosync-qdevice ] ; then + install -m 0644 /tmp/.sysconfig.corosync-qdevice %{_sysconfdir}/sysconfig/corosync-qdevice fi %files -n corosync-qdevice @@ -648,7 +663,10 @@ exit 0 ln -s /run/corosync-qnetd /var/run/ %endif %{fillup_only -n corosync-qnetd} -mv /etc/sysconfig/corosync-qnetd /etc/sysconfig/corosync-qnetdtmp +# Upgrade +if [ $1 -eq 2 ] ; then + install -m 0644 %{_sysconfdir}/sysconfig/corosync-qnetd /tmp/.sysconfig.corosync-qnetd +fi %service_add_post corosync-qnetd.service @@ -661,9 +679,14 @@ unlink /var/run/corosync-qnetd %service_del_postun corosync-qnetd.service +%postun -n corosync-qnetd +if [ -f %{_sysconfdir}/sysconfig/corosync-qnetd ]; then + rm %{_sysconfdir}/sysconfig/corosync-qnetd +fi + %posttrans -n corosync-qnetd -if [ ! -f /etc/sysconfig/corosync-qnetd ] ; then - mv /etc/sysconfig/corosync-qnetdtmp /etc/sysconfig/corosync-qnetd +if [ ! -f %{_sysconfdir}/sysconfig/corosync-qnetd ] ; then + install -m 0644 /tmp/.sysconfig.corosync-qnetd %{_sysconfdir}/sysconfig/corosync-qnetd fi %files -n corosync-qnetd