Bug 1258561

Summary: Gluster puts PID files in wrong place
Product: [Community] GlusterFS Reporter: Jeff Darcy <jdarcy>
Component: glusterdAssignee: bugs <bugs>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: mainlineCC: amukherj, bugs, joe, sasundar, smohan
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: glusterfs-3.13.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1480459 (view as bug list) Environment:
Last Closed: 2017-12-08 17:31:43 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:
Bug Depends On:    
Bug Blocks: 764795, 1480423, 1480459, 1480516, 1491059, 1491060    

Description Jeff Darcy 2015-08-31 16:03:33 UTC
There's not a lot of consistency here, but most of the PID files for Gluster-related services seem to be going into $sharedstatedir (i.e. /var/lib/gluster).  This is wrong.  First it's wrong because it violates the principle of keeping *configuration* separate from *run time state*.  Second it's wrong because it violates standards which respect this separation.  I couldn't find anything in Fedora/RHEL packaging guidelines, but I did find the GNU document describing what these automake/autoconf variables are supposed to mean.

https://www.gnu.org/prep/standards/html_node/Directory-Variables.html

According to that, what we're supposed to be using for per-node run-time state is $runstatedir (i.e. /var/run) which is itself supposed to be derived from $localstatedir (i.e. /var).  The doc specifically cites PID files as an example of what should be there.

One user already got bitten by this, because they were saving/restoring /var/lib/gluster across a server migration and ended up including bogus PID files.  Arguably their configuration/methodology is one we do not support, but that doesn't mean we should add extra obstacles that violate both standards and common sense.

(Component is unclassified because this affects multiple components.  I suggest that fixes in specific components be tracked by cloning this bug and adding a depencency.)

Comment 1 Kaleb KEITHLEY 2015-09-01 12:27:43 UTC
The Linux LSB, section 20.8 also says /var/run/basename.pid.

Comment 3 Vijay Bellur 2016-03-02 12:17:00 UTC
REVIEW: http://review.gluster.org/13580 (glusterfs: Gluster should put PID file in correct place (/var/run/gluster/*)) posted (#1) for review on master by Gaurav Kumar Garg (ggarg)

Comment 4 Mike McCune 2016-03-28 23:43:17 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 5 Vijay Bellur 2016-04-05 12:37:28 UTC
REVIEW: http://review.gluster.org/13580 (glusterfs: Gluster should put PID file in correct location (/var/run/gluster/*)) posted (#2) for review on master by Gaurav Kumar Garg (ggarg)

Comment 6 Vijay Bellur 2016-04-05 12:38:23 UTC
REVIEW: http://review.gluster.org/13580 (glusterfs: Gluster should keep PID file in correct location (/var/run/gluster/*)) posted (#3) for review on master by Gaurav Kumar Garg (ggarg)

Comment 7 Vijay Bellur 2016-04-07 04:45:46 UTC
REVIEW: http://review.gluster.org/13580 (glusterfs: Gluster should keep PID file in correct location (/var/run/gluster/*)) posted (#4) for review on master by Gaurav Kumar Garg (ggarg)

Comment 8 Vijay Bellur 2016-04-07 10:30:01 UTC
REVIEW: http://review.gluster.org/13580 (glusterfs: Gluster should keep PID file in correct location (/var/run/gluster/*)) posted (#5) for review on master by Gaurav Kumar Garg (ggarg)

Comment 9 Vijay Bellur 2016-05-09 12:17:38 UTC
REVIEW: http://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#6) for review on master by Gaurav Kumar Garg (ggarg)

Comment 10 Vijay Bellur 2016-05-12 09:29:26 UTC
REVIEW: http://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#7) for review on master by Gaurav Kumar Garg (ggarg)

Comment 11 Vijay Bellur 2016-05-15 02:24:02 UTC
REVIEW: http://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#8) for review on master by Gaurav Kumar Garg (ggarg)

Comment 12 Vijay Bellur 2016-05-16 07:02:19 UTC
REVIEW: http://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#9) for review on master by Gaurav Kumar Garg (ggarg)

Comment 13 Vijay Bellur 2016-05-16 07:13:18 UTC
REVIEW: http://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#10) for review on master by Gaurav Kumar Garg (ggarg)

Comment 14 Vijay Bellur 2016-05-20 06:15:32 UTC
REVIEW: http://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#11) for review on master by Gaurav Kumar Garg (ggarg)

Comment 15 Worker Ant 2016-09-30 12:02:24 UTC
REVIEW: http://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#12) for review on master by Saravanakumar Arumugam (sarumuga)

Comment 16 Worker Ant 2016-10-03 14:58:18 UTC
REVIEW: http://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#13) for review on master by Saravanakumar Arumugam (sarumuga)

Comment 17 Worker Ant 2016-10-14 06:54:05 UTC
REVIEW: http://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#14) for review on master by Saravanakumar Arumugam (sarumuga)

Comment 18 Worker Ant 2016-10-14 14:18:48 UTC
REVIEW: http://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#15) for review on master by Saravanakumar Arumugam (sarumuga)

Comment 19 Worker Ant 2016-10-17 12:00:15 UTC
REVIEW: http://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#16) for review on master by Saravanakumar Arumugam (sarumuga)

Comment 20 Worker Ant 2016-10-24 07:26:14 UTC
REVIEW: http://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#17) for review on master by Saravanakumar Arumugam (sarumuga)

Comment 21 Worker Ant 2017-01-10 11:10:43 UTC
REVIEW: http://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#18) for review on master by Saravanakumar Arumugam (sarumuga)

Comment 22 Worker Ant 2017-01-10 11:57:20 UTC
REVIEW: http://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#19) for review on master by Saravanakumar Arumugam (sarumuga)

Comment 23 Atin Mukherjee 2017-04-11 15:35:26 UTC
*** Bug 764795 has been marked as a duplicate of this bug. ***

Comment 24 Worker Ant 2017-08-10 12:16:29 UTC
REVIEW: https://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#20) for review on master by MOHIT AGRAWAL (moagrawa)

Comment 25 Worker Ant 2017-08-10 13:07:46 UTC
REVIEW: https://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#21) for review on master by MOHIT AGRAWAL (moagrawa)

Comment 26 Worker Ant 2017-08-10 15:46:20 UTC
REVIEW: https://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#22) for review on master by MOHIT AGRAWAL (moagrawa)

Comment 27 Worker Ant 2017-08-11 01:51:08 UTC
REVIEW: https://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#23) for review on master by MOHIT AGRAWAL (moagrawa)

Comment 28 Worker Ant 2017-08-11 02:21:17 UTC
REVIEW: https://review.gluster.org/13580 (glusterd: Gluster should keep PID file in correct location) posted (#24) for review on master by MOHIT AGRAWAL (moagrawa)

Comment 29 Worker Ant 2017-08-11 07:36:45 UTC
COMMIT: https://review.gluster.org/13580 committed in master by Atin Mukherjee (amukherj) 
------
commit 220d406ad13d840e950eef001a2b36f87570058d
Author: Gaurav Kumar Garg <garg.gaurav52>
Date:   Wed Mar 2 17:42:07 2016 +0530

    glusterd: Gluster should keep PID file in correct location
    
    Currently Gluster keeps process pid information of all the daemons
    and brick processes in Gluster configuration file directory
    (ie., /var/lib/glusterd/*).
    
    These pid files should be seperate from configuration files.
    Deletion of the configuration file directory might result into serious problems.
    Also, /var/run/gluster is the default placeholder directory for pid files.
    
    So, with this fix Gluster will keep all process pid information of all
    processes in /var/run/gluster/* directory.
    
    Change-Id: Idb09e3fccb6a7355fbac1df31082637c8d7ab5b4
    BUG: 1258561
    Signed-off-by: Gaurav Kumar Garg <ggarg>
    Signed-off-by: Saravanakumar Arumugam <sarumuga>
    Reviewed-on: https://review.gluster.org/13580
    Tested-by: MOHIT AGRAWAL <moagrawa>
    Smoke: Gluster Build System <jenkins.org>
    CentOS-regression: Gluster Build System <jenkins.org>
    Reviewed-by: Atin Mukherjee <amukherj>

Comment 30 Shyamsundar 2017-12-08 17:31:43 UTC
This bug is getting closed because a release has been made available that should address the reported issue. In case the problem is still not fixed with glusterfs-3.13.0, please open a new bug report.

glusterfs-3.13.0 has been announced on the Gluster mailinglists [1], packages for several distributions should become available in the near future. Keep an eye on the Gluster Users mailinglist [2] and the update infrastructure for your distribution.

[1] http://lists.gluster.org/pipermail/announce/2017-December/000087.html
[2] https://www.gluster.org/pipermail/gluster-users/