Package issues during update
It was found that when updating to Stork 1.15.0 (in this case from 1.14.0) on RHEL 7 (and CentOS 7 though engineering states that this problem likely applies to all versions) that there are two problems encountered:
- The Stork Server service ends up stopped in the disabled state even though it was enabled and started prior to update.
- The
useradd
call in the postinstall script sets the homedir to/var/lib
instead of/var/lib/stork-server
.
A patch was provided by the reporter:
diff --git a/etc/hooks/rpm/isc-stork-server.postinst b/etc/hooks/rpm/isc-stork-server.postinst
index 3b890b75..7833efd4 100644
--- a/etc/hooks/rpm/isc-stork-server.postinst
+++ b/etc/hooks/rpm/isc-stork-server.postinst
@@ -4,5 +4,5 @@ set -eu
# add stork-server user if does not exist
if ! getent passwd stork-server > /dev/null; then
- useradd --system --home-dir /var/lib/ stork-server
+ useradd --system --base-dir /var/lib/ stork-server
fi
diff --git a/etc/hooks/rpm/isc-stork-server.prerm b/etc/hooks/rpm/isc-stork-server.prerm
index e4649e2c..cc007fbc 100644
--- a/etc/hooks/rpm/isc-stork-server.prerm
+++ b/etc/hooks/rpm/isc-stork-server.prerm
@@ -1,16 +1,17 @@
#!/bin/sh
set -eu
-
-has_active_systemd=0
-if command -v systemctl > /dev/null; then
- status=$(systemctl is-system-running || true)
- if [ "${status}" = "running" ] || [ "${status}" = "degraded" ] || [ "${status}" = "maintenance" ]; then
- has_active_systemd=1
+if [ "$1" -eq 0 ]; then # Uninstall == 0 not Upgrade == 1
+ has_active_systemd=0
+ if command -v systemctl > /dev/null; then
+ status=$(systemctl is-system-running || true)
+ if [ "${status}" = "running" ] || [ "${status}" = "degraded" ] || [ "${status}" = "maintenance" ]; then
+ has_active_systemd=1
+ fi
fi
-fi
-if [ $has_active_systemd -eq 1 ]; then
- systemctl disable isc-stork-server
- systemctl stop isc-stork-server
-fi
+ if [ $has_active_systemd -eq 1 ]; then
+ systemctl disable isc-stork-server
+ systemctl stop isc-stork-server
+ fi
+fi