Graylog2 / graylog-ansible-role

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

Centos 7 mongodb needs `systemctl daemon-reload` before start #120

Closed marcin-github closed 4 years ago

marcin-github commented 5 years ago

Because ansible uses own system unit for mongod it is needed to run systemctl daemon-reload before start mongod.

marcin-github commented 5 years ago

And... why is used custom unit to start mongod?

malcyon commented 4 years ago

When the service file template is copied over, it calls a handler to restart systemd:

https://github.com/Graylog2/graylog-ansible-role/blob/master/tasks/mongodb-RedHat.yml#L33 https://github.com/Graylog2/graylog-ansible-role/blob/master/handlers/main.yml#L3-L5

So, it should be doing that.

I'm not sure about the custom service file. Looking through the commit history, it looks like it was to fix an issue with MongoDB not starting when SELinux is enabled (See: https://github.com/Graylog2/graylog-ansible-role/pull/87).