While trying to get MongoDB working on a Fedora 15 test server I found that there was no way of installing the latest version with SystemD control due to a pre-existing known bug.
To Mongo’s credit there is a file provided in the source under rpm/init.d-mongod, however when it comes to this being used by SystemD, well it just errors.
This was frustrating, but as I was doing it on a VM, I did what any logical person would do. Installed Mongo from the package manager, took a copy of the required SystemD files, reverted to a snapshot, then installed the latest version of Mongo from source.
After this I adapted the mongod.service file to use the correct locations, ensured all the required directories, files and users were present on the system then started the service et voila, working latest version of MongoDB on Fedora 15 with SystemD
the two required files are:
/lib/systemd/system/mongod.service
/etc/sysconfig/mongod
Or you can just use the RedHat distro based install script I created:
One thought on “Installing MongoDB on a Linux distro using SystemD instead of inittab”
One thought on “Installing MongoDB on a Linux distro using SystemD instead of inittab”