[SERVER-27016] mongod.pid is not removed when calling db.shutdownServer(), preventing subsequent init.d start Created: 14/Nov/16 Updated: 06/Feb/23 Resolved: 06/Feb/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin, Packaging |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Yoni Douek | Assignee: | [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive) |
| Resolution: | Won't Do | Votes: | 1 |
| Labels: | sdp-backlog-purge | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Assigned Teams: |
Server Development Platform
|
||||||||||||||||
| Sprint: | Build 2016-11-21 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Story Points: | 5 | ||||||||||||||||
| Description |
|
We're running mongod as an init.d service (Amazon linux), v.3.2.10 -
We then rm the pid file and start, but this is very annoying. |
| Comments |
| Comment by Iryna Zhuravlova [ 16/Nov/22 ] | |||||||||||||||||||||||
|
After a careful backlog refinement, the team decided to close this ticket because of its low priority and limited resource capacity. If you believe that this ticket requires additional attention from the team and should be re-opened, feel free to change the status to "Needs Scheduling" and ping me or @alexander.neben | |||||||||||||||||||||||
| Comment by Ralph Seichter [ 30/Sep/18 ] | |||||||||||||||||||||||
|
I was quite surprised to see this bug is still open in MongoDB 4.0.2 Enterprise, almost two years after it has been filed. Any ideas when this will be fixed? It is highly annoying. | |||||||||||||||||||||||
| Comment by Leam Hall [ 02/Feb/18 ] | |||||||||||||||||||||||
|
In 3.6.2 for RHEL/CentOS the same issue. With an upgrade from 3.4 to 3.6 several issues prevented mongod from starting via the init script, but the init script failed to remove the pid file. | |||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 27/Jan/17 ] | |||||||||||||||||||||||
|
Hi yoni@appsee.com, unfortunately this ticket is not scheduled to land in a stable release yet. Not removing the pid file when using db.shutdownServer() is intentional (see I'll ask around to see if the init scripts can be made a bit smarter around this issue. In the mean time, if you're using a modern distribution I'd let init scripts handle the mongod service. Regards, | |||||||||||||||||||||||
| Comment by Yoni Douek [ 27/Jan/17 ] | |||||||||||||||||||||||
|
Hey Ramon, Any news on this / chance to squeeze it into 3.2.12? Thanks! | |||||||||||||||||||||||
| Comment by Yoni Douek [ 14/Nov/16 ] | |||||||||||||||||||||||
|
You are correct, sorry for misleading you. I assume this is not the expected behavior anyway (3.2.1 worked with shutdownServer). Another issue is that if there's a problem starting mongod (for example - directory permission issues) - if you start it with init.d - it starts, fails, but the pid is still there and you need to delete it to retry. Worth cleaning on errors too (that's how it was in 3.2.1 also). Thanks | |||||||||||||||||||||||
| Comment by Ramon Fernandez Marina [ 14/Nov/16 ] | |||||||||||||||||||||||
|
I can reproduce this behavior if I shut down mongod using db.shutdownServer() and then try to start it with init scripts, since it seems the init scripts are the ones removing the pid file. I am unable to reproduce the behavior you describe when I use only init scripts to start/stop the server. | |||||||||||||||||||||||
| Comment by Yoni Douek [ 14/Nov/16 ] | |||||||||||||||||||||||
|
Here's our conf file -
pidFilePath here is exactly as the one in your init.d script. |