[SERVER-15724] Cannot write pid file to /var/run/mongodb/mongod.pid: No such file or directory Created: 19/Oct/14  Updated: 28/Oct/14  Resolved: 28/Oct/14

Status: Closed
Project: Core Server
Component/s: Packaging
Affects Version/s: 2.6.4
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Tomas Dabašinskas Assignee: Ernie Hershey
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-7285 Support systemd in future compatible ... Closed
duplicates SERVER-14679 (CentOS 7/RHEL 7) init.d script shoul... Closed
is duplicated by DOCS-4209 Comment on: "manual/tutorial/install-... Closed
Operating System: ALL
Participants:

 Description   

I've logged this under docs, but I think core is probably more appropriate:

----------------

Hi,
I'm running mongo server on rhel7 and systemd: # rpm -q mongodb-org-server
mongodb-org-server-2.6.4-1.x86_64

I'm trying to run the daemon: # /etc/rc.d/init.d/mongod start
Starting mongod (via systemctl): Job for mongod.service failed. See 'systemctl status mongod.service' and 'journalctl -xn' for details.
[FAILED]

when I look at the log, I'm seeing:
2014-10-20T11:36:28.085+0530 ***** SERVER RESTARTED *****
2014-10-20T11:36:28.087+0530 ERROR: Cannot write pid file to /var/run/mongodb/mongod.pid: No such file or directory

The way around it is to create mongodb.conf in /lib/tmpfiles.d/ with following content:
d /var/run/mongodb 0755 mongod mongod

Please add /lib/tmpfiles.d/mongodb.conf to mongodb-org-server package

http://stackoverflow.com/questions/23086655/mongodb-service-will-not-start-after-initial-setup

Many thanks,
Tomas



 Comments   
Comment by Ramon Fernandez Marina [ 28/Oct/14 ]

tomasd, this is to let you know that systemd support is handled under SERVER-7285, so feel free to watch that ticket for updates and/or vote for it.

Comment by Tomas Dabašinskas [ 23/Oct/14 ]

Hi Ramon,
Many thanks for getting back.
Yep, I've updated the package and I can now see /var/run/mongodb:

  1. rpm -ql mongodb-org-server
    /etc/init.d/mongod
    /etc/mongod.conf
    /etc/sysconfig/mongod
    /usr/bin/mongod
    /usr/share/man/man1/mongod.1
    /var/lib/mongo
    /var/log/mongodb
    /var/log/mongodb/mongod.log
    /var/run/mongodb

on systemd systems it would be good idea to distribute /lib/tmpfiles.d/mongodb.conf, other packages are using it:

  1. ls /lib/tmpfiles.d
    abrt.conf cups-lp.conf httpd.conf iscsi.conf libselinux.conf mdadm.conf pam.conf rpm.conf saslauthd.conf spice-vdagentd.conf systemd.conf tmp.conf cups.conf gvfsd-fuse-tmpfiles.conf initscripts.conf legacy.conf lvm2.conf mongodb.conf ppp.conf samba.conf selinux-policy.conf subscription-manager.conf systemd-nologin.conf x11.conf

I'm not sure how that would affect non systemd systems. Please feel free to resolve this.

Comment by Ramon Fernandez Marina [ 20/Oct/14 ]

Hi tomasd, thanks for opening this ticket. This bug should have been fixed by SERVER-14679 – can you please try with 2.6.5 and see if the problem is fixed?

Comment by Tomas Dabašinskas [ 19/Oct/14 ]

docs bug: https://jira.mongodb.org/browse/DOCS-4209

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