-
Problem report
-
Resolution: Fixed
-
Trivial
-
4.4.8, 5.0.0
-
SLES 12
Prior agent version 4.4.7-1
-
Sprint 73 (Feb 2021), Sprint 74 (Mar 2021), Sprint 75 (Apr 2021), Sprint 76 (May 2021), Sprint 77 (Jun 2021), Sprint 78 (Jul 2021), Sprint 79 (Aug 2021)
-
1.5
Steps to reproduce:
- Upgrade to 4.4.8-1 on SLES 12
- Will give RPM warning:
(22/22) Installing: zabbix-agent-4.4.8-1.el12.x86_64 ...................................[done]
Additional rpm output:
/var/tmp/rpm-tmp.CQLBOR: line 1: fg: no job control
warning: %post(zabbix-agent-4.4.8-1.el12.x86_64) scriptlet failed, exit status 1
/var/tmp/rpm-tmp.AeDB4F: line 1: fg: no job control
warning: %postun(zabbix-agent-4.4.7-1.el12.x86_64) scriptlet failed, exit status 1
- Running rpm -q --scripts zabbix-agent shows:
preinstall scriptlet (using /bin/sh):
getent group zabbix > /dev/null || groupadd -r zabbix
getent passwd zabbix > /dev/null || \
useradd -r -g zabbix -d /var/lib/zabbix -s /sbin/nologin \
-c "Zabbix Monitoring System" zabbix
:
postinstall scriptlet (using /bin/sh):
%systemd_post zabbix-agent.service
preuninstall scriptlet (using /bin/sh):
if [ "$1" = 0 ]; then
%systemd_preun zabbix-agent.service
fi
:
postuninstall scriptlet (using /bin/sh):
%systemd_postun_with_restart zabbix-agent.service
... - "%systemd_post", "%systemd_preun", "%systemd_postun_with_restart". These are RPM macros that are meant to be expanded when the RPM package is built. As to the reason for the error above, the RPM scriptlets are run through /bin/sh:
Result:
Errors on upgrade/install, service not being restarted as expected on upgrade.
Expected:
No warnings, post-install scriptlets should run
Fix:
Build machine needs packages built with BuildRequires: systemd-rpm-macros