Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-17686

Scriptlets not running in SLES 12 zabbix-agent build for 4.4.8

XMLWordPrintable

    • 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:

      1. Upgrade to 4.4.8-1 on SLES 12
      2. 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

      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
        ...

         

      2. "%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

            yurii Jurijs Klopovskis
            jhalder Joseph Halder
            Team I
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: