...
I updated mongodb via repo.mongodb.org, but it did not start the service when it is done because: ERROR: Cannot write pid file to /var/run/mongod.pid: Permission denied The /etc/init.d/mongod script does not check for permissions of the mongodb user on the pid file. I think that would be the best place to solve this issue.
samk commented on Mon, 22 Jun 2015 19:51:38 +0000: I understand the issue you're having now. I believe that this behavior is expected, but I've opened DOCS-5696 to clarify this in the documentation. Sorry again for the confusion. Regards, sam martin.meier commented on Fri, 19 Jun 2015 15:27:47 +0000: Yea I kind of got your point about the pidFilePath in the config. It is a legal and documented configuration option though. I think it would not be difficult to set the owner of the pid file to the mongodb user or group if they exist. Or at least not overwrite the ownership of the pid file if someone has changed it. But I switched to another database that is more reliable in production. So I personaly don't bother anymore. The reason I used the option is inside you own documentation: http://docs.mongodb.org/manual/reference/configuration-options/ This is useful for tracking the mongos or mongod process in combination with the --fork option. Without a specified processManagement.pidFilePath option, the process creates no PID file. I did not have had a problem with how to make my mongodb running, I had a problem with the update script. You questions go in a totally different directions. I made myself very clear what I would expect from this update process, but you seem to not get the idea. ramon.fernandez commented on Thu, 18 Jun 2015 20:26:37 +0000: martin.meier, we haven't heard back from you for some time. If this is still an issue for you, can you please provide the information requested by Sam above? Thanks, Ramón. samk commented on Wed, 27 May 2015 17:58:40 +0000: Thanks for your answers to these questions. Just a few follow up questions: When you say "I created a new /etc/mongod.conf," are you saying that the installation process created this file and you edited it, or that you used your own custom configuration? Could you paste a copy of the full configuration here? Could you paste the output of the following command into this ticket? ls -lha /var/run /var/run/mongod.pid Why do you need to set the pidFilePath? This is not a default configuration, and is not set by default in the configuration (the initscript itself tracks the pidfile,) if you use the default init script and do not specify this option, do you still experience this issue? Regards, sam martin.meier commented on Mon, 18 May 2015 09:17:18 +0000: Hello, for the first installation of mongodb I followed this useful Page: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-debian/ I configured the server as part of a replication set with this great tutorial: http://docs.mongodb.org/manual/tutorial/deploy-replica-set/ I created a new /etc/mongod.conf (wich includes this: pidFilePath: "/var/run/mongod.pid") Then I upgraded from 3.0.1 to 3.0.3 via the normal apt-get update && apt-get upgrade procedure. Afterwords mongodb did not came up because of permissions for the pid file Does that answer all your questions? samk commented on Fri, 15 May 2015 18:01:56 +0000: Hello, Just so I understand this situation a bit more clearly, how was MognoDB confiogured before you installed using the packages? What user did the mognod process run as? How did you install MongoDB before installing the package? What version did you upgrade from? Cheers, sam