Graylog2 / graylog-ansible-role

Ansible role which installs and configures Graylog
Apache License 2.0
212 stars 127 forks source link

CentOS 7: Issue with MongoDB timing out SystemD #102

Closed BryannaM closed 3 years ago

BryannaM commented 5 years ago

In the Systemd service file for RHEL it has this line.

"PIDFile=/var/run/mongodb/mongod.pid"

Which means the mongod.conf needs to have a line to create that pid otherwise systemd will time out and fail to start the service.

pidFilePath: "/var/run/mongodb/mongod.pid"

silveraid commented 3 years ago

I just noticed this issue here, I have just submitted a PR to get this closed. It seems like the original attempt have failed due to lack of communication. #168

The difference between Debian and RedHat derivatives is that the systemd file (/lib/systemd/system/mongod.service) in RedHat has Type=forking specified for backwards compatibility where as Debian derivatives don't have this. We just simply need to differentiate between the two OS types and apply different config for each of them to make everything work as it should.

malcyon commented 3 years ago

Looks good now.