Bug 1431659

Summary: systemctl stop rhsmcertd leaves /var/run/rhsm/cert.pid behind
Product: Red Hat Enterprise Linux 7 Reporter: Barnaby Court <bcourt>
Component: subscription-managerAssignee: Kevin Howell <khowell>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: low Docs Contact:
Priority: medium    
Version: 7.2CC: khowell, redakkan, skallesh
Target Milestone: rcKeywords: Triaged
Target Release: 7.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: subscription-manager-1.19.6-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 19:21:47 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 Barnaby Court 2017-03-13 14:31:16 UTC
Description of problem:

systemctl stop rhsmcertd leaves /var/run/rhsm/cert.pid behind. The pid file should be cleaned up when the process is stopped. This does not cause problems for restarting the process but it does look strange. 

+ ls -l /var/run/rhsm/cert.pid
-rw-r--r-- 1 root root 5 Mar 10 16:46 /var/run/rhsm/cert.pid
+ cat /var/run/rhsm/cert.pid
11493
+ systemctl stop rhsmcertd
+ sleep 5
+ ls -l /var/run/rhsm/cert.pid
-rw-r--r-- 1 root root 5 Mar 10 16:46 /var/run/rhsm/cert.pid
+ cat /var/run/rhsm/cert.pid
11493

Stopping that really ought to clean up the .pid file.

Comment 2 Shwetha Kallesh 2017-04-13 15:06:07 UTC
Reproducer:

[root@bkr-hv03-guest33 home]# systemctl start rhsmcertd

[root@bkr-hv03-guest33 home]# ls -l /var/run/rhsm/cert.pid
-rw-r--r--. 1 root root 5 Apr 13 10:33 /var/run/rhsm/cert.pid

[root@bkr-hv03-guest33 home]# systemctl stop rhsmcertd
[root@bkr-hv03-guest33 home]# ls -l /var/run/rhsm/cert.pid
-rw-r--r--. 1 root root 5 Apr 13 10:33 /var/run/rhsm/cert.pid


Verification:

Kevin,

Dont see any /var/run/rhsm/cert.pid file being created when you start rhsmcertd service, was that intentional?

[root@bkr-hv03-guest33 ~]# systemctl start rhsmcertd
[root@bkr-hv03-guest33 ~]# sleep 120
[root@bkr-hv03-guest33 ~]# ls -l /var/run/rhsm/cert.pid
ls: cannot access /var/run/rhsm/cert.pid: No such file or directory

Comment 3 Shwetha Kallesh 2017-04-13 15:06:39 UTC
Forgot add the version of RHSM 

[root@bkr-hv03-guest33 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.9.51.21-1
subscription management rules: 5.15.1
subscription-manager: 1.19.7-1.el7
python-rhsm: 1.19.4-1.el7

Comment 4 Kevin Howell 2017-04-13 20:04:23 UTC
Shwetha, the cert.pid file may be short lived as it is only acquired for a short time during a check-in/autoheal.

Comment 5 Shwetha Kallesh 2017-04-17 07:22:12 UTC
Verified!!

[root@dhcp35-160 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 2.1.0-1
subscription management rules: 5.23
subscription-manager: 1.19.7-1.el7
python-rhsm: 1.19.4-1.el7


[root@dhcp35-160 ~]# service rhsmcertd restart
Redirecting to /bin/systemctl restart  rhsmcertd.service
[root@dhcp35-160 ~]# sleep 120
[root@dhcp35-160 ~]# ls -l /var/run/rhsm/cert.pid
ls: cannot access /var/run/rhsm/cert.pid: No such file or directory
[root@dhcp35-160 ~]# service rhsmcertd stop
Redirecting to /bin/systemctl stop  rhsmcertd.service
[root@dhcp35-160 ~]# ls -l /var/run/rhsm/cert.pid
ls: cannot access /var/run/rhsm/cert.pid: No such file or directory
[root@dhcp35-160 ~]#

Comment 6 errata-xmlrpc 2017-08-01 19:21:47 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:2083