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

Systemd update 241 on archlinux breaks systemd.py version() function #51745

Closed
fayak opened this issue Feb 21, 2019 · 7 comments

Comments

@fayak
Copy link

commented Feb 21, 2019

Description of Issue/Question

The version 241 of systemd introduced recently on archlinux has a different output for its version. Because of this different output, systemd.py can't parse it correctly and therefore leads to Unable to determine systemd version from systemctl from salt.

Output of systemctl --version on its latest version of archlinux : systemd 241 (241.7-2-arch)
salt/utils/systemd.py:68 expects a version formatted like systemd 241

Versions Report

salt : salt 2018.3.3-2 (from arch repo )
systemd: systemd 241 (241.7-2-arch) +PAM +AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid

@fayak

This comment has been minimized.

Copy link
Author

commented Feb 21, 2019

ret = int(outstr.splitlines()[0].split()[-1])

Change from ret = int(outstr.splitlines()[0].split()[-1]) to ret = int(outstr.splitlines()[0].split()[1]) may fix this issue, but I'm unsure if it will works on each plateform and versions of systemd unfortunately

@fayak

This comment has been minimized.

Copy link
Author

commented Feb 21, 2019

This may be linked : systemd/systemd#11230

@garethgreenaway

This comment has been minimized.

Copy link
Member

commented Feb 22, 2019

@fayak Thanks for the report.

@shtrom

This comment has been minimized.

Copy link
Contributor

commented Apr 4, 2019

For reference, this problem also shows up as follows in the sysctl module. The fix above fixes this issue too.

     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/usr/lib/python3/dist-packages/salt/state.py", line 1919, in call
                  **cdata['kwargs'])
                File "/usr/lib/python3/dist-packages/salt/loader.py", line 1918, in wrapper
                  return f(*args, **kwargs)
                File "/usr/lib/python3/dist-packages/salt/states/sysctl.py", line 58, in present
                  config = __salt__['sysctl.default_config']()
                File "/usr/lib/python3/dist-packages/salt/modules/linux_sysctl.py", line 54, in default_config
                  and salt.utils.systemd.version(__context__) >= 207:
              TypeError: '>=' not supported between instances of 'NoneType' and 'int'
@bdrung

This comment has been minimized.

Copy link
Contributor

commented Apr 26, 2019

Please also backport that patch to the 2018.3 release branch.

@gladia2r

This comment has been minimized.

Copy link

commented May 11, 2019

The changes from #51946 haven't made it yet in the packages?
This is still an issue in 2019.2 so far apparently:

~]# pacman -Q salt
salt 2019.2.0-2
~]# salt -V
Salt Version:
           Salt: 2019.2.0
...

System Versions:
           dist:   
         locale: UTF-8
        machine: x86_64
        release: 4.19.36-1-MANJARO
         system: Linux
        version: Not Installed
 ~]# systemctl --version
systemd 242 (242.16-1-manjaro)
+PAM +AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid
~]# salt-call state.apply
[ERROR   ] Unable to determine systemd version from systemctl --version, output follows:
systemd 242 (242.16-1-manjaro)
+PAM +AUDIT -SELINUX -IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid

After I made those change from the PR manually, it works fine.

@teran-mckinney

This comment has been minimized.

Copy link

commented Jul 10, 2019

I'm also running into this on Debian Buster which is now a stable release.

ferringb pushed a commit to ferringb/salt that referenced this issue Aug 7, 2019
Fixes saltstack#51745

Signed-off-by: Jordan Jacobelli <jordan@cri.epita.fr>
ferringb pushed a commit to ferringb/salt that referenced this issue Aug 7, 2019
Fixes saltstack#51745

Signed-off-by: Jordan Jacobelli <jordan@cri.epita.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.