From c2a32e82cc51a7dad077f81e2f9ebd241494edaa Mon Sep 17 00:00:00 2001 From: Michal Schorm Date: Sun, 9 Jun 2024 09:25:10 +0200 Subject: [PATCH] Fixup of systemd service rename MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the old galera was installed, and enabled with "systemctl enable garbd.service", it created symlink '/etc/systemd/system/garb.service' → '/usr/lib/systemd/system/garbd.service'. When new galera is installed, the target file of the symlink above no longer exists, and the new service is '/usr/lib/systemd/system/garb.service'. So calls for "systemctl start garbd" will fail as none such exists, and calls for "systemctl start garb" will fail as the old symlink in /etc/systemd takes precedence, and since it's target file does not exist, it reports that such systemd unit does not exist. By removing the old symlink, the newly installed '/usr/lib/systemd/system/garb.service' is recognized by the systemd again. And once 'systemctl enable garb.service' is called, it creates symlink: '/etc/systemd/system/garbd.service' → '/usr/lib/systemd/system/garb.service'. so the 'garbd' can be used again too. --- galera.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/galera.spec b/galera.spec index 3fb6ba1..9e98485 100644 --- a/galera.spec +++ b/galera.spec @@ -106,6 +106,8 @@ sed -i 's/User=nobody/User=garb/g' %{buildroot}%{_unitdir}/garb.service %pre /usr/sbin/useradd -M -r -d /dev/null -s /sbin/nologin -c "Galera Arbitrator Daemon" garb >/dev/null 2>&1 || : +# Fixup after upgrading on system before systemd unit rename +unlink /etc/systemd/system/garb.service || : %post /sbin/ldconfig