Hide Forgot
> 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.
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
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
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