1

Installed MongoDb 2.6.3 on OL 6.3 using yum, but the default init script seems to fail both when trying to stop and start the mongod service. I could trace the problem with stopping to $pid_file being detected as _/var/run/mongodb/mongod.pid (i.e with a space in front of the path). After that space was removed mongod could be stopped.
However, I cannot seem to start it using the same script (this was the case before the stop-fix too). After issuing the service mongod start command, I get ERROR: child process failed, exited with error number 1 and in the logs: ERROR: Cannot write pid file to /var/run/mongodb/mongod.pid: Success, right after the ***** SERVER RESTARTED ***** line, plus an empty pidfile gets created at the quoted location. Nothing else shows up even if I increase the log verbosity. Mongod starts fine if I run it as root, but the above happens if I use an unprivileged user (mongod). I could detect this by executing the command that eventually gets run with and without the user change - runuser -s /bin/bash mongod -c "ulimit -S -c 0 ; numactl --interleave=all /usr/bin/mongod -f /etc/mongod.conf"

Additional info - I am using the 2.4 configuration format:

logpath = /data/mongodb/log/mongod.log logappend = true fork = true dbpath = /data/mongodb/db auth = true port = 27017 pidfilepath = /var/run/mongodb/mongod.pid traceExceptions = true verbose = true vvvv = true keyFile=/data/mongodb/keyfile 

Checking the permissions on the pidfile path, they seemed okay (rx on the parents, rwx on mongodb). In addition, on another box (same OS) mongoDb 2.4 runs fine. Any idea?

EDIT - if I do not use a pidfile (no pidfilepath set), all seems to work fine, but that does not count as a solution, rather a workaround...

1 Answer 1

2

This seems to be related to SERVER-14679 "(CentOS 7/RHEL 7) init.d script should create directory for pid file if it is missing", which is fixed for 2.6.5.

In the meantime, please edit the init script according to this commit.

Please add a note to the ticket that it applies to Oracle Linux in case the modified init script starts MongoDB as expected.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.