[SERVER-25748] mongod fails to start with the default systemd service file Created: 23/Aug/16  Updated: 28/Sep/16  Resolved: 28/Sep/16

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

Type: Bug Priority: Major - P3
Reporter: Emil Burzo Assignee: Kelsey Schubert
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File mongo.txt    
Issue Links:
Related
related to DOCS-8850 For systemd mongd.service file need t... Closed
Operating System: ALL
Steps To Reproduce:

1. install mongod 3.2 on ubuntu xenial (16.04)
2. systemctl start mongod
3. check /var/log/mongodb/mongod.log for the error

Participants:

 Description   

Using the default systemd service file, either from the deb package or from the documentation[1] results in a fatal assertion (attached log).

However, adding the following in the systemd service file, under [Service]:

Type=forking

makes it start up without any issues.

I'm guessing it should be added by default?

[1] - https://docs.mongodb.com/master/tutorial/install-mongodb-on-ubuntu/



 Comments   
Comment by Kelsey Schubert [ 28/Sep/16 ]

Hi emilburzo,

Unfortunately, there isn't a good way to log this mismatch. However, on startup we do display the options:

2016-09-28T00:32:21.780-0400 I CONTROL  [initandlisten] MongoDB starting : pid=2341 port=27017 dbpath=/data/db 64-bit host=grey
2016-09-28T00:32:21.781-0400 I CONTROL  [initandlisten] db version v3.2.9
2016-09-28T00:32:21.781-0400 I CONTROL  [initandlisten] git version: 22ec9e93b40c85fc7cae7d56e7d6a02fd811088c
2016-09-28T00:32:21.781-0400 I CONTROL  [initandlisten] allocator: system
2016-09-28T00:32:21.781-0400 I CONTROL  [initandlisten] modules: none
2016-09-28T00:32:21.781-0400 I CONTROL  [initandlisten] build environment:
2016-09-28T00:32:21.781-0400 I CONTROL  [initandlisten]     distarch: x86_64
2016-09-28T00:32:21.781-0400 I CONTROL  [initandlisten]     target_arch: x86_64
2016-09-28T00:32:21.781-0400 I CONTROL  [initandlisten] options: { config: "mongodb.conf", processManagement: { fork: true }, systemLog: { destination: "file", logAppend: true, path: "mongod.log" } }

Additionally, there is a docs ticket that was recently opened, DOCS-8850, which will provide some clarity about this requirement in our documentation. Please feel free to vote for it and watch it.

Kind regards,
Thomas

Comment by Emil Burzo [ 15/Sep/16 ]

Good catch, I had the following left over in the config file from previous versions:

processManagement:
  fork: true  # fork and run in background

Is there any way to signal this to the user in the log file?

Comment by Kelsey Schubert [ 14/Sep/16 ]

Hi emilburzo,

Unfortunately, I haven't been able to reproduce the issue that you describe. So we can continue to investigate, would you please provide your MongoDB configuration file?

Thank you,
Thomas

Comment by Drew Burden [ 31/Aug/16 ]

I realize this is specifically for 3.2, but I would just like to mention that we are running MongoDB 3.0.5 via systemd without the Type line, and we have not experienced this issue.

Generated at Thu Feb 08 04:10:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.