Bug 2003151
| Summary: | Pacemaker lists 'service' agents ending in '@' but is unable to provide metadata for them | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Tomas Jelinek <tojeline> | |
| Component: | pacemaker | Assignee: | Chris Lumens <clumens> | |
| Status: | CLOSED ERRATA | QA Contact: | cluster-qe <cluster-qe> | |
| Severity: | low | Docs Contact: | ||
| Priority: | medium | |||
| Version: | 8.5 | CC: | cluster-maint, kgaillot, msmazova | |
| Target Milestone: | rc | Keywords: | Triaged | |
| Target Release: | 8.6 | Flags: | pm-rhel:
mirror+
|
|
| Hardware: | All | |||
| OS: | All | |||
| Whiteboard: | ||||
| Fixed In Version: | pacemaker-2.1.2-2.el8 | Doc Type: | Bug Fix | |
| Doc Text: |
This affects a very small subset of users, and is mainly for pcs, so a release note is not needed.
Cause: Pacemaker did not recognize systemd service names ending in "@" when resolving a "service:" resource specification.
Consequence: Attempting to show meta-data for such a resource would show an error.
Fix: Pacemaker now recognizes systemd service names ending in "@".
Result: Meta-data queries for such resources succeed.
|
Story Points: | --- | |
| Clone Of: | ||||
| : | 2032031 (view as bug list) | Environment: | ||
| Last Closed: | 2022-05-10 14:09:46 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: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 2032031 | |||
|
Description
Tomas Jelinek
2021-09-10 13:15:05 UTC
You're right, this is a bug in service handling. I think the issue is ultimately in systemd_unit_by_name() not handling names with "@" specially. It's worth noting that any of these forms already work for a systemd unit that uses "@":
crm_resource --show-metadata service:$UNIT
crm_resource --show-metadata service:$UNIT@$SUBUNIT
crm_resource --show-metadata systemd:$UNIT@
so the problem is limited to the one case
crm_resource --show-metadata service:$UNIT@
(In reply to Ken Gaillot from comment #2) > It's worth noting that any of these forms already work for a systemd unit > that uses "@": > > crm_resource --show-metadata service:$UNIT > crm_resource --show-metadata service:$UNIT@$SUBUNIT > crm_resource --show-metadata systemd:$UNIT@ > > so the problem is limited to the one case > > crm_resource --show-metadata service:$UNIT@ It's a little trickier than that. I think in this case, the top three commands work only because there is both an sshd.service and an sshd@.service file. If you try something that doesn't have both (like user@service), the result is: [root@cluster01 system]# crm_resource --show-metadata service:user crm_resource: Metadata query for service:user failed: No such device or address Error performing operation: No such object [root@cluster01 system]# crm_resource --show-metadata service:user@ crm_resource: Metadata query for service:user@ failed: No such device or address Error performing operation: No such object If you add enough -Vs, you'll see what is going on: # crm_resource --show-metadata service:sshd@ -VVVVVVV ... (pcmk_dbus_find_error) trace: DBus reply indicated error 'org.freedesktop.DBus.Error.InvalidArgs' (Unit name sshd@.service is missing the instance name.) (pcmk_dbus_find_error) trace: DBus reply indicated error 'org.freedesktop.DBus.Error.InvalidArgs' (Unit name sshd@.service is missing the instance name.) (expand_resource_class) info: Assuming resource class lsb for agent sshd@ for sshd@ (services__get_lsb_metadata) trace: Looking into /etc/rc.d/init.d/sshd@ And sure enough, if you try cramming some text after the @ sign (the instance name): # crm_resource --show-metadata service:sshd@root <?xml version="1.0"?> ... It works. Fixed in upstream master branch by commit 09ef95a before fix ------------- > [root@virt-530 ~]# rpm -q pacemaker > pacemaker-2.1.0-8.el8.x86_64 List "service" agents with "@" in name: > [root@virt-530 ~]# crm_resource --list-agents service | grep @ > autovt@ > chrony-dnssrv@ > chrony-dnssrv@.timer > container-getty@ > getty@ > lvm2-pvscan@ > qarshd@ > rdma-load-modules@ > serial-getty@ > sshd-keygen@ > sshd@ > systemd-backlight@ > systemd-coredump@ > systemd-fsck@ > systemd-hibernate-resume@ > teamd@ > user-runtime-dir@ > user@ > vdo-start-by-dev@ Try to show metadata: > [root@virt-530 ~]# crm_resource --show-metadata service:sshd@ > crm_resource: Metadata query for service:sshd@ failed: No such device or address > Error performing operation: No such object > [root@virt-530 ~]# crm_resource --show-metadata service:user@ > crm_resource: Metadata query for service:user@ failed: No such device or address > Error performing operation: No such object Unable to fetch metadata. after fix ---------- > [root@virt-524 ~]# rpm -q pacemaker > pacemaker-2.1.2-2.el8.x86_64 List "service" agents with "@" in name: > [root@virt-524 ~]# crm_resource --list-agents service | grep @ > autovt@ > chrony-dnssrv@ > chrony-dnssrv@.timer > container-getty@ > getty@ > lvm2-pvscan@ > qarshd@ > serial-getty@ > sshd-keygen@ > sshd@ > systemd-backlight@ > systemd-coredump@ > systemd-fsck@ > systemd-hibernate-resume@ > teamd@ > user-runtime-dir@ > user@ > vdo-start-by-dev@ Try to show metadata: > [root@virt-524 ~]# crm_resource --show-metadata service:sshd@ > <?xml version="1.0"?> > <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd"> > <resource-agent name="sshd@" version="0.1"> > <version>1.1</version> > <longdesc lang="en"> > OpenSSH per-connection server daemon > </longdesc> > <shortdesc lang="en">systemd unit file for sshd@</shortdesc> > <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"/> > </resource-agent> > [root@virt-524 ~]# crm_resource --show-metadata service:user@ > <?xml version="1.0"?> > <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd"> > <resource-agent name="user@" version="0.1"> > <version>1.1</version> > <longdesc lang="en"> > User Manager for UID x > </longdesc> > <shortdesc lang="en">systemd unit file for user@</shortdesc> > <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"/> > </resource-agent> Metadata for "service" agent `service:chrony-dnssrv@.timer` can't be fetched. This has been reported as bug2045096 > [root@virt-524 ~]# crm_resource --show-metadata service:chrony-dnssrv@.timer -VVV > (crm_log_args) notice: Invoked: crm_resource --show-metadata service:chrony-dnssrv@.timer -VVV > (lrmd_api_get_metadata_params) error: Failed to retrieve meta-data for service:(null):chrony-dnssrv@.timer > crm_resource: Metadata query for service:chrony-dnssrv@.timer failed: No such device or address > Error performing operation: No such object verified in pacemaker-2.1.2-2.el8, one issue has been found and reported as bug2045096 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 (pacemaker bug fix and enhancement update), 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/RHBA-2022:1885 |