From ca1e0ce6d910f41b9abec5cb3a4b76c06a6019265bb91b4ceb3d5874d99763ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 14 Nov 2016 13:39:27 +0000 Subject: [PATCH] Accepting request 440124 from home:kukuk:branches:Base:System - Move logrotate.status to /var/lib/misc following FHS/LSB and making implementing read-only root filesystem much easier. [FATE#322036] OBS-URL: https://build.opensuse.org/request/show/440124 OBS-URL: https://build.opensuse.org/package/show/Base:System/logrotate?expand=0&rev=50 --- logrotate-var-lib-misc.patch | 20 ++++++++++++++++++++ logrotate.changes | 7 +++++++ logrotate.spec | 10 ++++++++++ 3 files changed, 37 insertions(+) create mode 100644 logrotate-var-lib-misc.patch diff --git a/logrotate-var-lib-misc.patch b/logrotate-var-lib-misc.patch new file mode 100644 index 0000000..5bdc656 --- /dev/null +++ b/logrotate-var-lib-misc.patch @@ -0,0 +1,20 @@ +--- config.h ++++ config.h 2016/11/12 21:04:31 +@@ -43,5 +43,5 @@ + #endif + + #ifndef STATEFILE +-#define STATEFILE "/var/lib/logrotate.status" ++#define STATEFILE "/var/lib/misc/logrotate.status" + #endif +--- logrotate.8 ++++ logrotate.8 2016/11/12 21:00:05 +@@ -65,7 +65,7 @@ + \fB\-s\fR, \fB\-\-state \fR + Tells \fBlogrotate\fR to use an alternate state file. This is useful + if logrotate is being run as a different user for various sets of +-log files. The default state file is \fI/var/lib/logrotate.status\fR. ++log files. The default state file is \fI/var/lib/misc/logrotate.status\fR. + + .TP + \fB\-\-usage\fR diff --git a/logrotate.changes b/logrotate.changes index 83973a8..4abcf34 100644 --- a/logrotate.changes +++ b/logrotate.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Nov 12 22:08:25 CET 2016 - kukuk@suse.de + +- Move logrotate.status to /var/lib/misc following FHS/LSB and + making implementing read-only root filesystem much easier. + [FATE#322036] + ------------------------------------------------------------------- Wed Oct 5 11:38:13 UTC 2016 - tchvatal@suse.com diff --git a/logrotate.spec b/logrotate.spec index a487aa3..2631740 100644 --- a/logrotate.spec +++ b/logrotate.spec @@ -34,6 +34,11 @@ Patch3: logrotate-addextension.patch Patch5: logrotate-manpage_config_clarification.patch # PATCH-FIX-UPSTREAM logrotate-fix-test62_with_bash-4.4.patch gh#logrotate/logrotate#66 dimstar@opensuse.org -- Fix test suite in combination with bash 4.4 Patch6: logrotate-fix-test62_with_bash-4.4.patch +# PATCH-FEATURE-SLE logrotate-var-lib-misc.patch FATE#322036: +# According to FHS/LSB, this should be in /var/lib/misc. Which +# would allow a read-only root filesystem without breaking snapshots, +# rollback and transactional updates +Patch7: logrotate-var-lib-misc.patch BuildRequires: acl BuildRequires: libacl-devel BuildRequires: libselinux-devel @@ -60,6 +65,7 @@ daily cron job. %patch3 %patch5 -p1 %patch6 -p1 +%patch7 -p0 %build %configure @@ -87,6 +93,10 @@ if [ -f %{_sysconfdir}/logrotate.d/aaa_base ] ; then echo "Saving old logrotate system configuration" mv -v %{_sysconfdir}/logrotate.d/aaa_base %{_sysconfdir}/logrotate.d.aaa_base.save fi +# Move /var/lib/logrotate.status +if [ -f /var/lib/logrotate.status -a !-f /var/lib/misc/logrotate.status ]; then + mv /var/lib/logrotate.status /var/lib/misc/logrotate.status ||: +fi %service_add_post %{name}.service %{name}.timer