Im trying to start mongod. I run "sudo service mongod start", but I get:
Failed to unlink socket file /tmp/mongodb-27017.sock errno:1 Operation not permitted
Theres a question here but I have tried all solutions to no avail https://stackoverflow.com/questions/29813648/failed-to-unlink-socket-file-error-in-mongodb-3-0
When I run "ls -ld /tmp" I see:
drwxrwxrwt 3 root root 4096 Jun 1 18:20 /tmp
When I run "ls -l /tmp/mongodb-27017.sock" I see:
srwx------ 1 mongod mongod 0 Jun 1 18:20 /tmp/mongodb-27017.sock
Mongod needs to be run with sudo, otherwise I get a permissions error. The problem started when I moved the
/var/lib/mongo folder, then moved it back where it was. Now Mongod wont start.
Im on AWS EC2...
EDIT I've tried:
sudo chown mongod:mongod /tmp/mongodb-27017.sock
Tried deleting the file, same error. Tried:
# chown root:root /tmp # chmod 1777 /tmp