[SERVER-9424] search for mongod PID file in wrong location Created: 23/Apr/13  Updated: 10/Dec/14  Resolved: 08/Mar/14

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

Type: Bug Priority: Blocker - P1
Reporter: Ron Warshawsky Assignee: Adam Comerford
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Fedora 17


Issue Links:
Duplicate
duplicates SERVER-12514 mongo-10gen-server rpm/yum init scrip... Closed
Operating System: Linux
Steps To Reproduce:

1. Configure custom PID file location in /etc/mongod.conf

2. Start mongo with "service mongod start" fails

Participants:

 Description   

Instaed of accessing configured PID file at

/export/home/mongo/DB1/mongodDB1.pid

Mongo is trying access:

/var/run/mongo/mongod.pid

========================================

cat /etc/mongod.conf
# mongo.conf
 
#where to log
logpath=/export/home/mongo/DB1/log/mongoDB1.log
 
logappend=true
 
# fork and run in background
fork = true
 
#port = 27017
 
dbpath=/export/home/mongo/DB1/data
 
# location of pidfile
pidfilepath = /export/home/mongo/DB1/mongodDB1.pid

======

Mongo start service hangs for minutes and fails:

[root@localhost ~]# service mongod start
Starting mongod (via systemctl):
 
 
 
Job failed. See system journal and 'systemctl status' for details.
                                                           [FAILED]

=============

Mongo is running after failure:

[root@localhost ~]# ps -ef | grep mongo
mongod    1036     1  0 03:05 ?        00:00:01 /usr/bin/mongod -f /etc/mongod.conf
root      1121  1049  0 03:12 pts/1    00:00:00 grep --color=auto mongo

=============

Log info:

Apr 23 03:05:52 localhost mongod[1028]: Starting mongod: Tue Apr 23 03:05:52.466
Apr 23 03:05:52 localhost mongod[1028]: Tue Apr 23 03:05:52.467 warning: 32-bit servers don't have journaling enabled by default. Please use --journal if you want durability.
Apr 23 03:05:52 localhost mongod[1028]: Tue Apr 23 03:05:52.468
Apr 23 03:05:52 localhost mongod[1028]: about to fork child process, waiting until server is ready for connections.
Apr 23 03:05:52 localhost mongod[1028]: forked process: 1036
Apr 23 03:05:52 localhost mongod[1028]: all output going to: /export/home/mongo/DB1/log/mongoDB1.log
Apr 23 03:05:52 localhost mongod[1028]: child process started successfully, parent exiting
Apr 23 03:05:52 localhost mongod[1028]: [  OK  ]
 
Apr 23 03:05:52 localhost systemd[1]: PID file /var/run/mongo/mongod.pid not readable (yet?) after start.



 Comments   
Comment by Daniel Pasette (Inactive) [ 08/Mar/14 ]

duplicate of SERVER-12514

Comment by Franz Pletz [ 30/Jan/14 ]

This is not a mongo problem. Systemd is expecting the PID file at /var/run/mongo/mongod.pid but you specified /export/home/mongo/DB1/mongodDB1.pid manually. If want to use your custom PID file location, add the PIDFile option to your systemd service config (see man 5 systemd.service).

Comment by Adam Comerford [ 22/May/13 ]

Can you confirm the contents of the PID file when this happens? This may be related to SERVER-6008 but there have been some long standing issues with Fedora also, around not creating the correct paths for files. Checking the contents of the file should confirm one way or another.

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