Bug 1382364
Summary: | crm_resource does not list systemd services properly | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Tomas Jelinek <tojeline> |
Component: | pacemaker | Assignee: | Ken Gaillot <kgaillot> |
Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.3 | CC: | abeekhof, cluster-maint, mmuzikov, mnovacek |
Target Milestone: | rc | ||
Target Release: | 7.5 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | pacemaker-1.1.18-2.el7 | Doc Type: | Enhancement |
Doc Text: |
Feature: When listing available systemd agents, Pacemaker's crm_resource (and therefore pcs) will now list all systemd unit files, not just active ones, and will order them alphabetically.
Reason: Previously, crm_resource would only show active systemd units, which are not the ones of interest to someone looking for agents available for use.
Result: The list of systemd agents is now more useful to end users.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2018-04-10 15:28:37 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
Tomas Jelinek
2016-10-06 13:22:03 UTC
Confirmed -- this was recently reported upstream, too. Recently a bug was found in pcs upstream in parsing systemd: (and service:) resource agent names: bz1419661. The same bug is in crm_resource as well: [root@rh73-node1:~]# crm_resource --show-metadata systemd:nonexistent@some:thing <?xml version="1.0"?> <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd"> <resource-agent name="thing" version="0.1"> <version>1.0</version> <longdesc lang="en"> thing.service </longdesc> <shortdesc lang="en">systemd unit file for thing</shortdesc> <parameters> </parameters> <actions> <action name="start" timeout="100" /> <action name="stop" timeout="100" /> <action name="status" timeout="100" /> <action name="monitor" timeout="100" interval="60"/> <action name="meta-data" timeout="5" /> </actions> <special tag="systemd"> </special> </resource-agent> Agent name should be "nonexistent@some:thing" not just "thing". This however may become irrelevant once pacemaker switches to ListUnitFiles. I don't think we're going to make the 7.4 deadline for this, so bumping to 7.5. QA: To test, run: crm_resource --list-agents systemd Before the fix, the output will only show active systemd units, not those that are disabled and thus available for cluster management. Also, the output will be unsorted. After the fix, the output will show all systemd units that can be managed by the cluster, and they will be sorted alphabetically. (In reply to Tomas Jelinek from comment #3) > Recently a bug was found in pcs upstream in parsing systemd: (and service:) > resource agent names: bz1419661. The same bug is in crm_resource as well: > > [root@rh73-node1:~]# crm_resource --show-metadata > systemd:nonexistent@some:thing > <?xml version="1.0"?> > <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd"> > <resource-agent name="thing" version="0.1"> > <version>1.0</version> > <longdesc lang="en"> > thing.service > </longdesc> > <shortdesc lang="en">systemd unit file for thing</shortdesc> > <parameters> > </parameters> > <actions> > <action name="start" timeout="100" /> > <action name="stop" timeout="100" /> > <action name="status" timeout="100" /> > <action name="monitor" timeout="100" interval="60"/> > <action name="meta-data" timeout="5" /> > </actions> > <special tag="systemd"> > </special> > </resource-agent> > > Agent name should be "nonexistent@some:thing" not just "thing". > > This however may become irrelevant once pacemaker switches to ListUnitFiles. The above issue is also fixed in the same build. Marking Verified in version pacemaker-1.1.18-11.el7. 1) BEFORE fix - crm_resource does not list available resources which are disabled and not running ============= # rpm -q pacemaker pacemaker-1.1.16-12.el7_4.7.x86_64 ## crm_resource lists postfix service when it is enabled # systemctl list-unit-files | grep postfix postfix.service enabled # crm_resource --list-agents systemd | grep postfix postfix ## postfix service is no longer in crm_resource list after it was disabled and stopped # systemctl disable postfix Removed symlink /etc/systemd/system/multi-user.target.wants/postfix.service. # systemctl stop postfix # systemctl list-unit-files | grep postfix postfix.service disabled # crm_resource --list-agents systemd | grep postfix # echo $? 1 2) AFTER fix - crm_resource lists available resources which are disabled and not running ============= # rpm -q pacemaker pacemaker-1.1.18-11.el7.x86_64 # systemctl list-unit-files | grep postfix postfix.service enabled # crm_resource --list-agents systemd | grep postfix postfix # systemctl disable postfix Removed symlink /etc/systemd/system/multi-user.target.wants/postfix.service. # systemctl stop postfix # systemctl list-unit-files | grep postfix postfix.service disabled # crm_resource --list-agents systemd | grep postfix postfix ## units in list are sorted alphabetically # crm_resource --list-agents systemd | head abrt-ccpp abrt-oops abrt-pstoreoops abrt-vmcore abrt-xorg abrtd arp-ethers atd auditd auth-rpcgss-module # crm_resource --list-agents systemd | tail systemd-update-utmp systemd-update-utmp-runlevel systemd-user-sessions systemd-vconsole-setup tcsd teamd@ tuned unbound-anchor usb_modeswitch@ wpa_supplicant Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:0860 |