From 1c09ae681be303d994af2b7b6d491936ae0465f3 Mon Sep 17 00:00:00 2001 From: Kristoffer Gronlund Date: Fri, 29 Jun 2018 07:42:57 +0000 Subject: [PATCH 1/2] Accepting request 602563 from home:elvigia:branches:network:ha-clustering:Factory - fix pre/post/preun/postun scripts when systemd_enabled - insserv_prereq is only needed when !systemd_enabled - run fillup to actually provision /etc/sysconfig/o2cb OBS-URL: https://build.opensuse.org/request/show/602563 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/ocfs2-tools?expand=0&rev=113 --- ocfs2-tools.changes | 7 +++++++ ocfs2-tools.spec | 30 +++++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/ocfs2-tools.changes b/ocfs2-tools.changes index 1fcb5e8..31a7712 100644 --- a/ocfs2-tools.changes +++ b/ocfs2-tools.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Apr 30 13:49:06 UTC 2018 - crrodriguez@opensuse.org + +- fix pre/post/preun/postun scripts when systemd_enabled +- insserv_prereq is only needed when !systemd_enabled +- run fillup to actually provision /etc/sysconfig/o2cb + ------------------------------------------------------------------- Wed Dec 13 03:11:37 UTC 2017 - lchen@suse.com diff --git a/ocfs2-tools.spec b/ocfs2-tools.spec index 8b62391..242c9e1 100644 --- a/ocfs2-tools.spec +++ b/ocfs2-tools.spec @@ -1,7 +1,7 @@ # # spec file for package ocfs2-tools # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -37,7 +37,7 @@ Name: ocfs2-tools Version: 1.8.5 Release: 0 Summary: Oracle Cluster File System 2 Core Tools -License: GPL-2.0 +License: GPL-2.0-only Group: System/Filesystems Url: https://ocfs2.wiki.kernel.org/ Source: ocfs2-tools-%{version}.tar.gz @@ -72,7 +72,6 @@ BuildRequires: update-desktop-files BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(libxml-2.0) Requires(pre): %fillup_prereq -Requires(pre): %insserv_prereq Requires: /sbin/chkconfig Requires: e2fsprogs Requires: glib2 >= 2.2.3 @@ -81,9 +80,10 @@ Requires: net-tools BuildRoot: %{_tmppath}/%{name}-%{version}-build Recommends: ocfs2-kmp %if 0%{?suse_version} >= 1315 - %define systemd_enabled 1 +%define systemd_enabled 1 %else - %define systemd_enabled 0 +%define systemd_enabled 0 +Requires(pre): %insserv_prereq %endif %description @@ -224,14 +224,34 @@ chmod a-x %{buildroot}/%{_libdir}/libocfs2.a %if 0%{_ocfs2console} == 1 python -c "import compileall; compileall.compile_dir('%{buildroot}/%{py_sitedir}/ocfs2interface', ddir='%{py_sitedir}/ocfs2interface')" %endif + +%pre o2cb +%if %{systemd_enabled} +%service_add_pre ocfs2.service o2cb.service +%endif + %preun o2cb +%if %{systemd_enabled} +%service_del_preun ocfs2.service o2cb.service +%else %stop_on_removal ocfs2 %stop_on_removal o2cb +%endif + +%post o2cb +%fillup_only -n o2cb +%if %{systemd_enabled} +%service_add_post ocfs2.service o2cb.service +%endif %postun o2cb +%if %{systemd_enabled} +%service_del_postun ocfs2.service o2cb.service +%else %{insserv_cleanup} %restart_on_update ocfs2 %restart_on_update o2cb +%endif %files %defattr(-,root,root) From 2d6547bf4a7b33a84d4ec44e584a7237cb4104a4 Mon Sep 17 00:00:00 2001 From: Kristoffer Gronlund Date: Tue, 14 Aug 2018 14:08:06 +0000 Subject: [PATCH 2/2] Fix empty %pre section if !systemd_enabled OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/ocfs2-tools?expand=0&rev=114 --- ocfs2-tools.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocfs2-tools.spec b/ocfs2-tools.spec index 242c9e1..2b49e6c 100644 --- a/ocfs2-tools.spec +++ b/ocfs2-tools.spec @@ -225,8 +225,8 @@ chmod a-x %{buildroot}/%{_libdir}/libocfs2.a python -c "import compileall; compileall.compile_dir('%{buildroot}/%{py_sitedir}/ocfs2interface', ddir='%{py_sitedir}/ocfs2interface')" %endif -%pre o2cb %if %{systemd_enabled} +%pre o2cb %service_add_pre ocfs2.service o2cb.service %endif