[SERVER-36809] Failed to unlink socket file /tmp/mongodb-27017.sock Unknown error Created: 22/Aug/18  Updated: 27/Oct/23  Resolved: 23/Aug/18

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

Type: Bug Priority: Major - P3
Reporter: Gabriel costa Assignee: Nick Brewer
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Manjaro


Participants:

 Description   

The file /tmp/mongodb-27017.sock is created with permissions, srwx------ 1 mongodb mongodb 0 ago 22 09:43 /tmp/mongodb-27017.sock, than i do change  permissions to my user and i am able to start mongd, but every time i reboot my system, permissions change again to srwx------ mongodb mongodb.

I have to other distros linux mint and debian the version of install by default is 3.4 i think and i have no problem with that.  



 Comments   
Comment by Nick Brewer [ 23/Aug/18 ]

gnoo These setting can be adjusted with your mongod configuration file via the net.unixDomainSocket set of options. Note that if you've installed the mongodb-org package from your package manager, and you're initializing it via, for example, systemd - you may need to change the user and group settings in /lib/systemd/system/mongod.service. You'll also need to make sure the user / group has the necessary permissions.

That said, unless you have a specific reason not to do so, it's probably going to be much easier to simply have mongod running using the mongodb user/group that it comes with by default. The socket file is generated when mongod starts, and is subsequently removed whenever mongod stop - so it's not unexpected that permissions changes wouldn't take effect. In general, attempting to directly modify the socket file in the way you've described shouldn't be necessary.

For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-user group.

-Nick

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