...
``` {"t":\{"$date":"2023-04-17T13:50:46.795+02:00"} ,"s":"I", "c":"CONTROL", "id":23330, "ctx":"main","msg":"ERROR: Cannot write pid file to {path_string}: {errAndStr_second}","attr":{"path_string":"/var/run/mongodb/mongod.pid","errAndStr_second":"No such file or directory"}} ``` mongod.conf ``` mongod.conf for documentation of all options, see: http://docs.mongodb.org/manual/reference/configuration-options/ where to write logging data. systemLog: destination: file logAppend: true path: /var/log/mongodb/mongod.log Where and how to store data. storage: dbPath: /var/lib/mongo journal: enabled: true engine: wiredTiger: how the process runs processManagement: fork: true # fork and run in background pidFilePath: /var/run/mongodb/mongod.pid # location of pidfile timeZoneInfo: /usr/share/zoneinfo network interfaces net: port: 27017 bindIpAll: true security: authorization: enabled keyFile: /etc/ssl/mongo_replica.key #operationProfiling: replication: replSetName: xxxx #sharding: Enterprise-Only Options #auditLog: #snmp: ``` OS: CentOS 7
xgen-internal-githook commented on Wed, 17 May 2023 18:49:17 +0000: Author: {'name': 'Alexander Neben', 'email': 'alexander.neben@mongodb.com', 'username': 'IamXander'} Message: SERVER-76179 Add RuntimeDirectory to mongod.service for RPM (cherry picked from commit e968d9507a2d038004de32250ea62edaa627d39e) Branch: v4.4 https://github.com/mongodb/mongo/commit/74e04c5444bdcea243c1328ce0ae5cb969bf7003 xgen-internal-githook commented on Thu, 4 May 2023 15:49:23 +0000: Author: {'name': 'Alexander Neben', 'email': 'alexander.neben@mongodb.com', 'username': 'IamXander'} Message: SERVER-76179 Add RuntimeDirectory to mongod.service for RPM (cherry picked from commit e968d9507a2d038004de32250ea62edaa627d39e) Branch: v7.0 https://github.com/mongodb/mongo/commit/ecc52df49ddbf748395f72484989424a366d465c xgen-internal-githook commented on Thu, 4 May 2023 15:33:07 +0000: Author: {'name': 'Alexander Neben', 'email': 'alexander.neben@mongodb.com', 'username': 'IamXander'} Message: SERVER-76179 Add RuntimeDirectory to mongod.service for RPM (cherry picked from commit e968d9507a2d038004de32250ea62edaa627d39e) Branch: v6.0 https://github.com/mongodb/mongo/commit/be7667ad1a93b9e87fc19ccdb43a5a9a3cddd948 xgen-internal-githook commented on Thu, 4 May 2023 15:20:27 +0000: Author: {'name': 'Alexander Neben', 'email': 'alexander.neben@mongodb.com', 'username': 'IamXander'} Message: SERVER-76179 Add RuntimeDirectory to mongod.service for RPM (cherry picked from commit e968d9507a2d038004de32250ea62edaa627d39e) Branch: v5.0 https://github.com/mongodb/mongo/commit/58e64eeac698a4cbc5e7210ffa7aacd2e9a2b931 xgen-internal-githook commented on Thu, 4 May 2023 01:16:10 +0000: Author: {'name': 'Alexander Neben', 'email': 'alexander.neben@mongodb.com', 'username': 'IamXander'} Message: SERVER-76179 Add RuntimeDirectory to mongod.service for RPM Branch: master https://github.com/mongodb/mongo/commit/e968d9507a2d038004de32250ea62edaa627d39e JIRAUSER1265262 commented on Mon, 17 Apr 2023 16:40:23 +0000: Thanks for your report, tedi.roca@gmail.com! This is related to SERVER-74345 which introduced a breaking change around --fork when using our Debian/RPM packages. We recently pushed SERVER-74845 to work around those breaking changes in 5.0.16, but this may be another issue we need to look into. In your case, the processManagement.pidFilePath line can be removed from mongod.conf to correct the problem for now.
Upgrade from Mongo 5.0.14 to 5.0.16 Start mongod with fork = true Now create the directroy manually an set the permissions for mongod to own it, and start mongod with fork = true - works fine: