[Bug 1093851] New: systemctl status wrong for global user services
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851 Bug ID: 1093851 Summary: systemctl status wrong for global user services Classification: openSUSE Product: openSUSE Distribution Version: Leap 15.0 Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Basesystem Assignee: bnc-team-screening@forge.provo.novell.com Reporter: masterpatricko@gmail.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- 'systemctl status' shows global user services as "disabled" regardless of true status
sudo systemctl --global enable redshift.service Created symlink /etc/systemd/user/default.target.wants/redshift.service → /usr/lib/systemd/user/redshift.service.
systemctl --global status redshift.service ● redshift.service - Redshift display colour temperature adjustment Loaded: loaded (/usr/lib/systemd/user/redshift.service; disabled; vendor preset: enabled) Active: inactive (dead)
(no difference with --user instead) This is also reflected in systemctl show:
systemctl --global show redshift.service | grep UnitFile UnitFileState=disabled UnitFilePreset=enabled
However, systemctl is-enabled works (though it is a bit confusing that --global is necessary here):
systemctl --global is-enabled redshift.service enabled systemctl --user is-enabled redshift.service disabled
grep -H . /usr/lib/systemd/user-preset/* /usr/lib/systemd/user-preset/99-default.preset:disable * systemctl --global status redshift.service ● redshift.service - Redshift display colour temperature adjustment Loaded: loaded (/usr/lib/systemd/user/redshift.service; disabled; vendor
Vendor preset status is also wrong: preset: enabled) Active: inactive (dead) Even though the preset works:
sudo systemctl --global enable redshift.service Created symlink /etc/systemd/user/default.target.wants/redshift.service → /usr/lib/systemd/user/redshift.service. sudo systemctl --global preset redshift.service Removed /etc/systemd/user/default.target.wants/redshift.service.
sudo systemctl --global disable redshift.service Removed /etc/systemd/user/default.target.wants/redshift.service. systemctl --user enable redshift.service Created symlink ~/.config/systemd/user/default.target.wants/redshift.service → /usr/lib/systemd/user/redshift.service. systemctl --user is-enabled redshift.service enabled systemctl --global is-enabled redshift.service disabled systemctl --user status redshift.service ● redshift.service - Redshift display colour temperature adjustment Loaded: loaded (/usr/lib/systemd/user/redshift.service; enabled; vendor
Only per-user service status works: preset: enabled) Active: inactive (dead)
rpm -q systemd systemd-234-lp150.19.1.x86_64 systemctl --version systemd 234 +PAM -AUDIT +SELINUX -IMA +APPARMOR -SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT -GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD -IDN2 -IDN default-hierarchy=hybrid
-- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851
Franck Bui
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851#c1
--- Comment #1 from Franck Bui
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851
Franck Bui
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851#c2
--- Comment #2 from Tejas Guruswamy
Isn't "--global" supposed to be used with "enable" or "disable" command only ?
That's what the man page seems to suggest.
Perhaps yes (and also preset; --user preset does not appear to read global presets. but then why the difference for is-enabled? i have not tested every command). However systemctl --user status gives same results for a globally-enabled service, and vendor preset is still wrong. I also tested doing a systemctl --user daemon-reload and even a reboot, no change. Only systemctl --global is-enabled shows correct globally-enabled state. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851#c3
--- Comment #3 from Franck Bui
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851#c4
--- Comment #4 from Tejas Guruswamy
Any chance you give it a try on TW ?
rpm -q systemd systemd-237-6.1.x86_64 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
service status is now correct with either 'systemctl status' or 'systemctl show' (with --user or --global, running as an individual user). is-enabled --global now reports 'enabled' if globally enabled, 'disabled' if only enabled for one user. is-enabled --user now reports 'enabled' if globally enabled, 'enabled' if only enabled for one user. So this now seems consistent if a little tricky to understand at first. I don't spot an explanation for why in the systemd changelog, but great! However: vendor preset state reported by status/show is still wrong (always enabled, despite preset application working). Also --user preset now appears to do nothing, only --global preset works. I suppose this makes sense. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851#c5
--- Comment #5 from Franck Bui
So this now seems consistent if a little tricky to understand at first. I don't spot an explanation for why in the systemd changelog, but great!
That's probably because it was fixed by upstream between v234 and v237 and we don't track such changes as they would be too numerous to make it part of the changelog. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851#c6
--- Comment #6 from Tejas Guruswamy
That's probably because it was fixed by upstream between v234 and v237 and we don't track such changes as they would be too numerous to make it part of the changelog.
I meant the upstream changelog :) But searching further I did find the commit which contains the fix: https://github.com/systemd/systemd/commit/d2561cfdf772c621963e62b52cfbf57d6f... if you are interested in backporting. Anyway, this only leaves the vendor preset reporting as wrong. Actually on further testing my statement of
Also --user preset now appears to do nothing, only --global preset works. I suppose this makes sense. is not true. --user preset still results in always enable, I think.
-- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851#c7
--- Comment #7 from Franck Bui
But searching further I did find the commit which contains the fix:
https://github.com/systemd/systemd/commit/ d2561cfdf772c621963e62b52cfbf57d6f75178d
if you are interested in backporting.
I'll take a look at it, thanks.
Anyway, this only leaves the vendor preset reporting as wrong.
I submitted a fix for that: https://github.com/systemd/systemd/pull/9063 -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851#c9
Franck Bui
So I backported them and the result should appear shortly here: http://users.suse.com/~fbui/boo-1093851
After almost 2 weeks, the packages are available eventually... Tejas could you give them a try ? Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851#c10
Tejas Guruswamy
zypper in http://users.suse.com/~fbui/boo-1093851/systemd-234.s use.169.g902674de3-lp150.75.1.x86_64.rpm http://users.suse.com/~fbui/boo-1093851/udev-234.suse.169.g902674de3-lp150.7... http://users.suse.com/~fbui/boo-1093851/systemd-sysvinit-234.suse.169.g90267... .75.1.x86_64.rpm
and am happy to report that service status and vendor preset reporting is correct for user & global services. Also I confirmed that user services now have a default preset of disabled. I had to run `systemctl daemon-reload` to see changes in the vendor preset. Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851#c11
--- Comment #11 from Franck Bui
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851
http://bugzilla.opensuse.org/show_bug.cgi?id=1093851#c12
Franck Bui
participants (1)
-
bugzilla_noreply@novell.com