Bug 1389501

Summary: [lib] pcs assumes booth arbitrator instance to be disabled based on wrong systemd input
Product: Red Hat Enterprise Linux 7 Reporter: Radek Steiger <rsteiger>
Component: pcsAssignee: Ondrej Mular <omular>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 7.3CC: cfeist, cluster-maint, idevat, mlisik, omular, tojeline
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 18:24:40 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 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: 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: 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