Bug 1206188

Summary: cman leaks temp file on unsuccessful start
Product: Red Hat Enterprise Linux 6 Reporter: Jaroslav Kortus <jkortus>
Component: clusterAssignee: Christine Caulfield <ccaulfie>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: low Docs Contact:
Priority: low    
Version: 6.7CC: ccaulfie, cluster-maint, jkortus, jpokorny, mjuricek, rpeterso, teigland
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-10 19:06: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 Jaroslav Kortus 2015-03-26 13:57:04 UTC
Description of problem:
if service cman start fails, it leaves behind file in the /tmp directory.


[root@virt-147 ~]# service cman start
Starting cluster: 
   Checking if cluster has been disabled at boot... [  OK  ]
   Checking Network Manager... [  OK  ]
   Global setup... [  OK  ]
   Loading kernel modules... [  OK  ]
   Mounting configfs... [  OK  ]
   Starting cman... Unable to update relaxng schema: /tmp/tmp.OvriT1TRhw/cluster.rng:5085: parser error : attributes construct error
uld be unique to a node and have to be written in /etc/multipath.conf. For the "
                                                                               ^
/tmp/tmp.OvriT1TRhw/cluster.rng:5085: parser error : Couldn't find end of Start Tag attribute line 5085
uld be unique to a node and have to be written in /etc/multipath.conf. For the "
                                                                               ^
generated schema does not pass xmllint validation
corosync died: Could not read cluster configuration Check cluster logs for details
[FAILED]
Stopping cluster: 
   Leaving fence domain... [  OK  ]
   Stopping gfs_controld... [  OK  ]
   Stopping dlm_controld... [  OK  ]
   Stopping fenced... [  OK  ]
   Stopping cman... [  OK  ]
   Unloading kernel modules... [  OK  ]
   Unmounting configfs... [  OK  ]
[root@virt-147 ~]# ll /tmp/tmp*
-rw-------. 1 root root 1509 Mar 26 14:52 /tmp/tmp.bJhBV0gmlr

The error messages are related to bug https://bugzilla.redhat.com/show_bug.cgi?id=1206185, it's possible these two are connected.

Version-Release number of selected component (if applicable):
cman-3.0.12.1-73.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. add invalid content to cluster.conf (for example:
        <cman><multicast addr="999.192.100.43"/></cman>
)
2. service cman start
3. see file being left in /tmp containing cluster configuration

Actual results:
extra file left in /tmp

Expected results:
no temporary files present when the scripts stop

Additional info:

Comment 6 Jan Pokorný [poki] 2015-04-10 10:49:31 UTC
Haven't read all the comments, but suggest NOTABUG: for keeping /tmp
clean, one should use tmpwatch utility (seems to be installed and enabled
by default).  There's a lot more leave-behind producers using /tmp
and never looking back in case of failure (or even in general).

Furthermore, permissions for the "leaked" file seems to be OK.

Comment 7 Jan Pokorný [poki] 2015-04-10 11:24:32 UTC
Re root cause:
fix expected with fence-agents-4.0.15-8.el6 [bug 1118008 comment 20]

Comment 13 Christine Caulfield 2015-11-20 15:57:35 UTC
commit 9cfdf3caa14da886360ee43162a7d9ea8386fba2
Author: Christine Caulfield <ccaulfie>
Date:   Fri Nov 20 15:56:59 2015 +0000

    cman: Delete tmpfile if ccs_config_validate fails.

Comment 17 errata-xmlrpc 2016-05-10 19:06:37 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://rhn.redhat.com/errata/RHBA-2016-0729.html