[SERVER-19716] remove socket when exiting because dbpath not found Created: 03/Aug/15 Updated: 27/Oct/22 Resolved: 27/Oct/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Admin |
| Affects Version/s: | 3.0.5 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Avi Levy | Assignee: | Amirsaman Memaripour |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Sprint: | Service Arch 2022-10-31 |
| Participants: |
| Description |
| Comments |
| Comment by Amirsaman Memaripour [ 27/Oct/22 ] |
|
Closing as "Gone Away" since this is no longer an issue (at least since v4.2). We start the TransportLayer way after verifying the the dbpath exists. For example, here is where we verify the dbpath on v4.2, and here is where we start the TransportLayer (e.g., create the socket file). |
| Comment by Lauren Lewis (Inactive) [ 21/Dec/21 ] |
|
We haven’t heard back from you in at least 1 year, so I'm going to close this ticket. If this is still an issue for you, please provide additional information and we will reopen the ticket. |
| Comment by Avi Levy [ 03/Aug/15 ] |
|
Thanks for explanation Ramon. I ran plain mongod by mistake (instead or running "service mongod start"). Thanks, |
| Comment by Ramon Fernandez Marina [ 03/Aug/15 ] |
|
Thanks for the additional info levyavi. Here's what happens; when you do the following:
mongod will create /tmp/mongodb-27017.sock, owned by root (because you're running mongod as root). Since you didn't specify a dbpath, mongod tries to use the default path, /data/db, but fails because it doesn't exist. Later you try to:
The service is probably configured to run as the mongod user, which has no permissions to remove /tmp/mongodb-27017.sock. This is expected behavior. Arguably mongod should clean /tmp/mongodb-27017.sock after existing, so we can reuse this ticket to consider this cleanup. That being said, please note it's strongly recommended to not run mongod as root. |
| Comment by Avi Levy [ 03/Aug/15 ] |
|
@Ramon Fernandez, 1. Run mongo - fails becuase mongodb is not running [root@foobar init.d]# mongo ***aborting after fassert() failure [root@foobar init.d]# ll /tmp/mongodb-27017.sock |
| Comment by Ramon Fernandez Marina [ 03/Aug/15 ] |
|
levyavi, are you able to reproduce this problem? It is not uncommon for the mongod service to run under a dedicated user, and for users to run it as "root" leaving a socket in the dbpath that can't be unlinked by the service user. Can you please retrace your steps and provide details of what you did, the exact error messages you get and the permissions of the socket file? Thanks, |