Mongodb service won't start

Hi,

I’ve installed mongodb and when I run:

systemctl start mongod

It will fail with

Job for mongod.service failed because the control process exited with error code. See “systemctl status mongod.service” and “journalctl -xe” for details.

Upon investigation it turns out that it can create the run pid in /var/run/mongodb/mongodb.pid because the it can’t create the mongodb dir.
I created the dir by hand and made mongo the owner but every time I restart the system the dir will get deleted.

Any idea why the dir get’s removed?

Well, firstly
Where did you get your mongodb?
I just ran a test on a TW using mongodb installed from the server repository. Although you can go to http://software.opensuse.org, the following would install the repo

zypper ar -f http://download.opensuse.org/repositories/server:/database/openSUSE_Factory/ http-download.opensuse.org-934d7ca7 

The name of the service is “mongodb.service” so if you’re really trying to start “mongod.service” it should return non-existent.
The following successfully starts mongodb

systemctl start mongodb.service

TSU

Thanks for the reply,

I followed the instructions from here https://docs.mongodb.org/master/tutorial/install-mongodb-on-suse

As I said in my initial post the service actually starts using systemctl start mongodb after I add the run folder.