From 3666bb84a79b703ef1d199f7915593f8a79ba833 Mon Sep 17 00:00:00 2001 From: Takuya ASADA Date: Sat, 3 Jul 2021 02:47:27 +0900 Subject: [PATCH] dist: stop removing /etc/systemd/system/*.mount on package uninstall Listing /etc/systemd/system/*.mount as ghost file seems incorrect, since user may want to keep using RAID volume / coredump directory after uninstalling Scylla, or user may want to upgrade enterprise version. Also, we mixed two types of files as ghost file, it should handle differently: 1. automatically generated by postinst scriptlet 2. generated by user invoked scylla_setup The package should remove only 1, since 2 is generated by user decision. However, just dropping .mount from %files section causes another problem, rpm will remove these files during upgrade, instead of uninstall (#8924). To fix both problem, specify .mount files as "%ghost %config". It will keep files both package upgrade and package remove. See scylladb/scylla-enterprise#1780 Closes #8810 Closes #8924 Closes #8959 (cherry picked from commit f71f9786c729c2b915e8ac994f6aa03f9762f5ea) --- dist/debian/debian/scylla-server.postrm | 2 -- dist/redhat/scylla.spec | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/dist/debian/debian/scylla-server.postrm b/dist/debian/debian/scylla-server.postrm index 2bb0486703..e6a4536118 100644 --- a/dist/debian/debian/scylla-server.postrm +++ b/dist/debian/debian/scylla-server.postrm @@ -12,8 +12,6 @@ case "$1" in if [ "$1" = "purge" ]; then rm -rf /etc/systemd/system/scylla-server.service.d/ fi - rm -f /etc/systemd/system/var-lib-systemd-coredump.mount - rm -f /etc/systemd/system/var-lib-scylla.mount ;; esac diff --git a/dist/redhat/scylla.spec b/dist/redhat/scylla.spec index 863c239e0e..0a89ba5fbd 100644 --- a/dist/redhat/scylla.spec +++ b/dist/redhat/scylla.spec @@ -142,9 +142,9 @@ rm -rf $RPM_BUILD_ROOT %ghost /etc/systemd/system/scylla-server.service.d/capabilities.conf %ghost /etc/systemd/system/scylla-server.service.d/mounts.conf /etc/systemd/system/scylla-server.service.d/dependencies.conf -%ghost /etc/systemd/system/var-lib-systemd-coredump.mount +%ghost %config /etc/systemd/system/var-lib-systemd-coredump.mount %ghost /etc/systemd/system/scylla-cpupower.service -%ghost /etc/systemd/system/var-lib-scylla.mount +%ghost %config /etc/systemd/system/var-lib-scylla.mount %package conf Group: Applications/Databases