[SERVER-18162] Fail to start with non-existing /var/run/mongodb/ Created: 21/Apr/15  Updated: 06/Apr/23  Resolved: 05/Jan/16

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: 3.0.2
Fix Version/s: 3.0.9, 3.1.2

Type: Bug Priority: Major - P3
Reporter: Cesar Izurieta Hidalgo Assignee: Ernie Hershey
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File mongod.patch    
Issue Links:
Duplicate
duplicates SERVER-7285 Support systemd in future compatible ... Closed
is duplicated by SERVER-22024 Mongod crash after restart (missing s... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Steps To Reproduce:

rm -r /var/run/mongodb/
systemctl start mongod

or:

rm -r /var/run/mongodb/
/etc/init.d/mongod start

Participants:

 Description   

When the init.d script is invoked without an existing /var/run/mongodb/, mongod fails to start. The variable PIDDIR is missing from the file. A fix is attached as a diff for /etc/init.d/mongod.

This is specially problematic in distros where /var/run is mounted as a tempfs where it's empty on every boot.



 Comments   
Comment by Githook User [ 07/Jan/16 ]

Author:

{u'username': u'cesarizu', u'name': u'C\xe9sar Izurieta', u'email': u'cesar@caih.org'}

Message: SERVER-18162 Make init.d script for suse work when /var/run/mongodb doesn't exist.

Signed-off-by: Ernie Hershey <ernie.hershey@10gen.com>
(cherry picked from commit 4b5008d8f72ab3cd023aba24ae017cc63db46e8e)
Branch: v3.0
https://github.com/mongodb/mongo/commit/69d50708a908841f851c165b4cd3bd8b1669d3b2

Comment by Githook User [ 22/Apr/15 ]

Author:

{u'username': u'cesarizu', u'name': u'C\xe9sar Izurieta', u'email': u'cesar@caih.org'}

Message: SERVER-18162 Make init.d script for suse work when /var/run/mongodb doesn't exist.

Signed-off-by: Ernie Hershey <ernie.hershey@10gen.com>
Branch: master
https://github.com/mongodb/mongo/commit/4b5008d8f72ab3cd023aba24ae017cc63db46e8e

Comment by Cesar Izurieta Hidalgo [ 22/Apr/15 ]

Thank you for your suggestion. I just did that: https://github.com/mongodb/mongo/pull/957

Comment by Ernie Hershey [ 22/Apr/15 ]

cesarizu - I believe fixing SERVER-7285 should also address the more general case of similar systems which aren't using systemd.

Thank you for the patch in any case. If you'd like to contribute a fix can you sign our contributor agreement and submit a pull request on github?

https://www.mongodb.com/legal/contributor-agreement
https://github.com/mongodb/mongo/

Comment by Cesar Izurieta Hidalgo [ 22/Apr/15 ]

This issue applies not only to systemd based systems, but also to SysV systems. I think it shouldn't be marked as a duplicated of SEVER-7285.

Generated at Thu Feb 08 03:46:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.