[SERVER-966] Mongo Server does not close stdin/stdout/stderr when using --fork Created: 05/Apr/10 Updated: 12/Jul/16 Resolved: 27/Apr/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 1.4.0 |
| Fix Version/s: | 1.5.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeremy Hinegardner | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
CentOS 5.4 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
The mongod server does not daemonize correctly. When using --fork it only fork's once and sets the session id. It really needs to fork an additional time and also close stdin/stdout/stderr. This is causing an issue for us when we do our backups of mongodb. Our process is: 1) ssh root@hostname "/etc/init.d/mongod stop" This can also be replicated without using an init script by running a command like: ssh root@hostname "/usr/bin/mongod --fork --logpath /var/log/mongo/mongod.log --dbpath /data/mongo/db" This will should return, but it does not. It hangs. I have verified that this can be fixed by having mongod close stdin/stdout/stderr if you use --fork. For reference http://www.svbug.com/documentation/comp.unix.programmer-FAQ/faq_2.html#SEC16 |
| Comments |
| Comment by auto [ 27/Apr/10 ] |
|
Author: {'login': 'RedBeard0531', 'name': 'Mathias Stearn', 'email': 'mathias@10gen.com'}Message: double forking + close stdin and stderr |