Answer the question
In order to leave comments, you need to log in
How to permanently put the owner of a .sock file on mongodb?
And I deleted this file, and manually set the rights to mongodb. The file is simply re-created after the mongod | sudomongod | sudo systemctl start mongod. And of course with root.
The logs still show this:
{"t":{"$date":"2021-12-05T20:20:34.514+00:00"},"s":"I", "c":"CONTROL", "id":20698, "ctx":"main","msg":"***** SERVER RESTARTED *****"}
{"t":{"$date":"2021-12-05T20:20:34.517+00:00"},"s":"I", "c":"CONTROL", "id":23285, "ctx":"main","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"}
{"t":{"$date":"2021-12-05T20:20:34.535+00:00"},"s":"W", "c":"ASIO", "id":22601, "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"}
{"t":{"$date":"2021-12-05T20:20:34.536+00:00"},"s":"I", "c":"NETWORK", "id":4648601, "ctx":"main","msg":"Implicit TCP FastOpen unavailable. If TCP FastOpen is required, set tcpFastOpenServer, tcpFastOpenClient, and tcpFastOpenQueueSize."}
{"t":{"$date":"2021-12-05T20:20:34.536+00:00"},"s":"I", "c":"STORAGE", "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":7151,"port":27017,"dbPath":"/var/lib/mongodb","architecture":"64-bit","host":"vm-e36ee522"}}
{"t":{"$date":"2021-12-05T20:20:34.536+00:00"},"s":"I", "c":"CONTROL", "id":23403, "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"4.4.8","gitVersion":"83b8bb8b6b325d8d8d3dfd2ad9f744bdad7d6ca0","openSSLVersion":"OpenSSL 1.1.1f 31 Mar 2020","modules":[],"allocator":"tcmalloc","environment":{"distmod":"ubuntu2004","distarch":"x86_64","target_arch":"x86_64"}}}}
{"t":{"$date":"2021-12-05T20:20:34.536+00:00"},"s":"I", "c":"CONTROL", "id":51765, "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Ubuntu","version":"20.04"}}}
{"t":{"$date":"2021-12-05T20:20:34.536+00:00"},"s":"I", "c":"CONTROL", "id":21951, "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"config":"/etc/mongod.conf","net":{"bindIp":"127.0.0.1","port":27017},"processManagement":{"timeZoneInfo":"/usr/share/zoneinfo"},"storage":{"dbPath":"/var/lib/mongodb","journal":{"enabled":true}},"systemLog":{"destination":"file","logAppend":true,"path":"/var/log/mongodb/mongod.log"}}}}
{"t":{"$date":"2021-12-05T20:20:34.537+00:00"},"s":"E", "c":"NETWORK", "id":23024, "ctx":"initandlisten","msg":"Failed to unlink socket file","attr":{"path":"/tmp/mongodb-27017.sock","error":"Operation not permitted"}}
{"t":{"$date":"2021-12-05T20:20:34.537+00:00"},"s":"F", "c":"-", "id":23091, "ctx":"initandlisten","msg":"Fatal assertion","attr":{"msgid":40486,"file":"src/mongo/transport/transport_layer_asio.cpp","line":919}}
{"t":{"$date":"2021-12-05T20:20:34.537+00:00"},"s":"F", "c":"-", "id":23092, "ctx":"initandlisten","msg":"\n\n***aborting after fassert() failure\n\n"}
Answer the question
In order to leave comments, you need to log in
Look at the mongod service configuration. It must be in the file /lib/systemd/system/mongod.service
.
The section title [Service]
should be followed by these lines:
User=mongodb
Group=mongodb
/tmp/mongodb-27017.sock
. Also, it’s better to start / restart the service only with the sudo systemctl start mongod.service
systemctl
says mongod
, and not mongod.service
, you probably use your own configuration to start, and then you need to edit another file - you should be aware of which one because they probably wrote it themselves. In the original service configuration file, which is created by default after installing MongoDB, the target user / group is written correctly and does not create problems.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question