docker-systemctl-replacement icon indicating copy to clipboard operation
docker-systemctl-replacement copied to clipboard

systemctl show does not respect multiple `-p/--property` switches

Open bo0ts opened this issue 1 year ago • 1 comments

systemctl show allows multiple properties to be printed. This is a feature used by chef to detect unit state...

Running on a real systemd installation:

# systemctl show -p Type -p Restart haproxy.service
Type=notify
Restart=always
# systemctl --version
systemd 237
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid

Running with the replacement python script. Notice the missing Type property:

# systemctl show -p Type -p Restart haproxy.service
Restart=always
# systemctl version
systemd 219
  - via systemctl.py 1.5.7417
-PAM -AUDIT -SELINUX -IMA -APPARMOR -SMACK +SYSVINIT -UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS -ACL -XZ -LZ4 -SECCOMP -BLKID -ELFUTILS -KMOD -IDN

bo0ts avatar Feb 05 '24 10:02 bo0ts

That allows for a generalization (develop branch)

gdraheim avatar Feb 05 '24 14:02 gdraheim