Bug 1389501 - [lib] pcs assumes booth arbitrator instance to be disabled based on wrong systemd input
Summary: [lib] pcs assumes booth arbitrator instance to be disabled based on wrong sys...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: pcs
Version: 7.3
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Ondrej Mular
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-27 18:22 UTC by Radek Steiger
Modified: 2017-08-01 18:24 UTC (History)
6 users (show)

Fixed In Version: pcs-0.9.156-1.el7
Doc Type: Bug Fix
Doc Text:
Cause: User wants to disable booth arbitrator service with command 'pcs booth disable'. Consequence: Booth arbitrator service is not disabled even though command exits successfully. Fix: Correctly check if booth service is installed. Result: Booth arbitrator service is disabled.
Clone Of:
Environment:
Last Closed: 2017-08-01 18:24:40 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1958 normal SHIPPED_LIVE pcs bug fix and enhancement update 2017-08-01 18:09:47 UTC

Description Radek Steiger 2016-10-27 18:22:40 UTC
> Description of problem:

Pcs uses 'systemctl list-unit-files' to determine whether a service exists or not. The problem here is that the booth uses unit file templates to spawn a named instance of booth (i.e. booth@booth), but these instances are never listed in a unit file list nor does the enablement status show up in list-units. While pcs correctly uses 'systemctl is-enabled' to figure out if it's enabled or not, the preceding check for service existence will never pass as booth@booth doesn't technically exist in the systemctl unit file listings. The correct way here would probably be to look for booth@ without an instance name first, and only then call the 'systemctl disable booth@booth' with the actual instance name.


> Version-Release number of selected component (if applicable):

pcs-0.9.152-9.el7.x86_64


> How reproducible:

Easily


> Steps to Reproduce:

1. systemctl enable booth@booth
2. pcs booth disable


> Actual results:

[root@duck-01 lib]# systemctl enable booth@booth
[root@duck-01 lib]# pcs booth disable
booth@booth disabled
[root@duck-01 lib]# systemctl is-enabled booth@booth
enabled


> Expected results:

[root@duck-01 lib]# systemctl enable booth@booth
[root@duck-01 lib]# pcs booth disable
booth@booth disabled
[root@duck-01 lib]# systemctl is-enabled booth@booth
disabled


> Additional info:

Oddly the 'pcs booth enable' works just fine as there is no such check present.

Comment 1 Ondrej Mular 2016-12-21 10:58:30 UTC
proposed fix:
https://github.com/ClusterLabs/pcs/commit/82f4970a94f8386dc2a9a9354b11a68dd5

TEST:
[root@rhel7-node1 ~]# pcs booth enable
booth@booth enabled
[root@rhel7-node1 ~]# systemctl is-enabled booth@booth
enabled
[root@rhel7-node1 ~]# pcs booth disable
booth@booth disabled
[root@rhel7-node1 ~]# systemctl is-enabled booth@booth
Failed to get unit file state for booth@booth.service: No such file or directory

Comment 3 Ivan Devat 2017-02-20 07:47:00 UTC
After Fix:

[vm-rhel72-1 ~] $ rpm -q pcs
pcs-0.9.156-1.el7.x86_64

[vm-rhel72-1 ~] $ pcs booth enable
booth@booth enabled
[vm-rhel72-1 ~] $ systemctl is-enabled booth@booth
enabled

[vm-rhel72-1 ~] $ pcs booth disable
booth@booth disabled
[vm-rhel72-1 ~] $ systemctl is-enabled booth@booth
Failed to get unit file state for booth@booth.service: No such file or directory

Comment 7 errata-xmlrpc 2017-08-01 18:24:40 UTC
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/RHBA-2017:1958


Note You need to log in before you can comment on or make changes to this bug.