[SERVER-32246] PID file permission on v3.6 make it not monitorable using pid file Created: 09/Dec/17  Updated: 30/Oct/23  Resolved: 14/Dec/17

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 3.6.0
Fix Version/s: 3.6.2, 3.7.1

Type: Bug Priority: Minor - P4
Reporter: Andrew Stiegmann Assignee: Jonathan Reams
Resolution: Fixed Votes: 0
Labels: regression
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.6
Steps To Reproduce:

Install datadog
Install mongod
Configure mongod to setup a pid file
Configure Datadog to monitor the mongod process using the pid file. This is done in /etc/dd-agent/conf.d/process.conf

Notice that on 3.4 it works. On 3.6 it no longer works.

Sprint: Platforms 2017-12-18
Participants:

 Description   

In v3.4 your server would create a pid file with permissions 644. In v3.6 it creates a PID file with permissions 600. This means that unless my monitoring tool runs as root or as the mongod user I can not use this file to monitor the health of the service. In example this breaks PID file monitoring with datadog.

Solution is to just check for the existence of a process named 'mongod', but I don't prefer that as much as the pid file (because using a PID file is the way systemd does it). Would it be possible to change the permissions back to 644. There isn't anything really gained by making it 600 as far as I can tell (maybe I'm wrong... pray tell if so). At a minimum please change the permissions to 640 so I can put my monitoring service in the mongod group and then it can monitor the service that way.



 Comments   
Comment by Githook User [ 04/Jan/18 ]

Author:

{'name': 'Jonathan Reams', 'username': 'jbreams', 'email': 'jbreams@mongodb.com'}

Message: SERVER-32246 loosen permission on pid file

(cherry picked from commit a08d6998928720aeea25546dca785f242b6b102d)
Branch: v3.6
https://github.com/mongodb/mongo/commit/2e346aaf5452b86a2106af645ddf65a51a9590fa

Comment by Githook User [ 14/Dec/17 ]

Author:

{'name': 'Jonathan Reams', 'email': 'jbreams@mongodb.com', 'username': 'jbreams'}

Message: SERVER-32246 loosen permission on pid file
Branch: master
https://github.com/mongodb/mongo/commit/a08d6998928720aeea25546dca785f242b6b102d

Generated at Thu Feb 08 04:29:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.