Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Updating Salt onedir RPMS on EL7 and EL8 don't restart services #65987

Closed
jcpearson opened this issue Feb 5, 2024 · 1 comment
Closed
Assignees
Labels
Bug broken, incorrect, or confusing behavior Packaging Related to packaging of Salt, not Salt's support for package management.

Comments

@jcpearson
Copy link

Description
When updating salt-minion, salt-master, salt-api, etc RPMS on EL7 (e.g. CentOS 7) and EL8 (e.g. Rocky 8), the services are not restarted - they are when the same is done on EL9 (e.g. Rocky 9)

Setup
Salt 3006.4 installed, attempting to upgrade to 3006.6

Please be as specific as possible and give set-up details.

  • on-prem machine
  • VM (VMware/Nutanix)
  • onedir packaging

Steps to Reproduce the behavior
On EL7/EL8, run: yum update salt-minion

Expected behavior
When updating (e.g.) salt-minion, the salt-minon service should restart - it doesn't on EL7 or EL8 - but does on EL9

Versions Report

salt --versions-report
Salt Version:
          Salt: 3006.4
 
Python Version:
        Python: 3.10.13 (main, Oct  4 2023, 21:54:22) [GCC 11.2.0]
 
Dependency Versions:
          cffi: 1.14.6
      cherrypy: unknown
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.2
       libgit2: Not Installed
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.9.8
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.13.12
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: centos 7.9.2009 Core
        locale: utf-8
       machine: x86_64
       release: 3.10.0-1160.81.1.el7.x86_64
        system: Linux
       version: CentOS Linux 7.9.2009 Core

Additional context
It appears the onedir RPMS for EL7/EL8/EL9 are built/packaged on an EL9 system (or similar)

The postuninstall scriptlet added to (e.g.) the salt-minion RPM starts with:

if [ $1 -ge 1 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then 
    # Package upgrade, not uninstall 
    /usr/lib/systemd/systemd-update-helper mark-restart-system-units salt-minion.service || : 
fi 

The RPM spec file for these packages uses systemd macros to define what is done at the various pre/post install stages - e.g. the '%postun minion' section at: https://github.com/saltstack/salt/blob/master/pkg/rpm/salt.spec#L565 has:

%postun minion
%systemd_postun_with_restart salt-minion.service

However, depending on which OS the RPM is built on, the '%systemd_postun_with_restart' will do different things ... on EL9 it will generate the postuninstall scriptlet above, but on EL7 and EL8, the macro doesn't use '/usr/lib/systemd/systemd-update-helper' - as this doesn't exist on EL7 or EL8 ...

The upshot is that as '/usr/lib/systemd/systemd-update-helper' doesn't exist, the various Salt services are not restarted on upgrade on EL7 or EL8 (there are also similar problems on install and removal of these RPMS)

The 'fix' would be to build the EL7 and EL8 RPMS on an EL7 or EL8 host - or alter the spec file to do the right thing for all versions of EL7/EL8/EL9

@jcpearson jcpearson added Bug broken, incorrect, or confusing behavior needs-triage labels Feb 5, 2024
@dmurphy18 dmurphy18 assigned ScriptAutomate and felippeb and unassigned dmurphy18 Feb 7, 2024
@ScriptAutomate ScriptAutomate added Packaging Related to packaging of Salt, not Salt's support for package management. and removed needs-triage labels Feb 8, 2024
@ScriptAutomate ScriptAutomate assigned twangboy and unassigned twangboy Feb 14, 2024
@ScriptAutomate
Copy link
Contributor

This should be resolved in the next 3006.x point release due to completion of:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Packaging Related to packaging of Salt, not Salt's support for package management.
Projects
None yet
Development

No branches or pull requests

5 participants