Bug 1073481
| Summary: | systeclt's commands 'is-failed' or 'is-active return unknown in result when state is inactive | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Miroslav Lisik <mlisik> |
| Component: | systemd | Assignee: | systemd-maint |
| Status: | CLOSED WONTFIX | QA Contact: | qe-baseos-daemons |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.0 | CC: | awilliam, jkortus, jscotka, lnykryn, ralongi, systemd-maint-list |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-08-21 08:08:43 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Miroslav Lisik
2014-03-06 14:03:06 UTC
This request was not resolved in time for the current release. Red Hat invites you to ask your support representative to propose this request, if still desired, for consideration in the next release of Red Hat Enterprise Linux. Problem here is that there is difference between unit file and unit. is-active and is-failed operates strictly on units. We can't say that pacemaker is inactive, because we simply just see that there is no such unit and we can't decide if it is the case that service was stopped and removed by garbage collector or there is no unit file at all. So I am sorry but this is WONTFIX/CANTFIX/NOTABUG for me. Lukas, I don't understand your explanation here. What's the difference between unit and unit-file? systemd can clearly determine if the service a) exists and b) is active or stopped or dead or failed. So why can't this knowledge get propagated via is-failed command? # systemctl status pacemaker pacemaker.service - Pacemaker High Availability Cluster Manager Loaded: loaded (/usr/lib/systemd/system/pacemaker.service; disabled) Active: inactive (dead) # systemctl is-failed pacemaker unknown This does not make much sense to me. Unit file is file on the disk, unit is a structure in systemd memory, unit does not need an unit file and to save memory we don't have units for unit files which are not needed. ok and now once again (as you did not respond to it): So why can't this knowledge get propagated via is-failed command? # systemctl status pacemaker pacemaker.service - Pacemaker High Availability Cluster Manager Loaded: loaded (/usr/lib/systemd/system/pacemaker.service; disabled) Active: inactive (dead) # systemctl is-failed pacemaker unknown This actually seems to work on F21:
[adamw@adam gnome-initial-setup (f21 %)]$ systemctl status iscsid.service
● iscsid.service - Open-iSCSI
Loaded: loaded (/usr/lib/systemd/system/iscsid.service; disabled)
Active: inactive (dead)
Docs: man:iscsid(8)
man:iscsiadm(8)
[adamw@adam gnome-initial-setup (f21 %)]$ systemctl is-failed iscsid
inactive
[adamw@adam gnome-initial-setup (f21 %)]$
did something change, Lukas?
The same thing works in rhel [lnykryn@notas initscripts(rhel7-branch)]$ systemctl is-active avahi-daemon.service unknown [lnykryn@notas initscripts(rhel7-branch)]$ systemctl status avahi-daemon.service avahi-daemon.service - Avahi mDNS/DNS-SD Stack Loaded: loaded (/usr/lib/systemd/system/avahi-daemon.service; disabled) Active: inactive (dead) [lnykryn@notas initscripts(rhel7-branch)]$ systemctl is-active avahi-daemon.service inactive Status is more complex function with creates a unit in systemd manager. Than you can view its status through is-active until garbage collectors eats it. ah, I see. well, then it works in a very inconsistent way. The commands should return the same result unless the service state has changed. Making one's result depend on what has been run before is more kind of your internal magic than anything user friendly ;). Is there any dependable machine-parsable command that would produce reliable output? > Is there any dependable machine-parsable command that would produce reliable
> output?
Sure
$ systemctl show bluetooth.service -p ActiveState
ActiveState=inactive
And there is a stability promise for this command. So you should definitely use this one in scripts.
*** Bug 1417251 has been marked as a duplicate of this bug. *** |