Graylog2 / graylog-ansible-role

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

Fix startup timeout (unexpected sig 15) for MongoDB service/process m… #86

Closed alexkross closed 6 years ago

alexkross commented 6 years ago

Issue and solution: https://serverfault.com/a/867472

More explanation here: https://askubuntu.com/a/787431 (quotation below)

"... mongod is completely unnecessarily forking. Because it is forking, systemd is thinking that the main dæmon process has exited unexpectedly, and it is cleaning up the service back to its stopped state. It does this by explicitly terminating all of the child processes left around by the service. Hence the signal.

This is a readiness protocol mismatch. MongoDB does not speak the forking readiness protocol, and it is not correct to change the systemd service unit to say that it does. It is, rather, correct to change the configuration of MongoDB so that it does not completely unnecessarily fork."

CLAassistant commented 6 years ago

CLA assistant check
All committers have signed the CLA.

mariussturm commented 6 years ago

Hi, and thanks for the PR! What happens on systems without Systemd e.g. Ubuntu 14.04 when forking is disabled?

alexkross commented 6 years ago

Problem is not distribution specific, but directly related to how mongod is assumed to be started according to this role. So Ubuntu/Debian, as well as other systemd-based distros, probably also affected.

mariussturm commented 6 years ago

I think we should add a detection if Systemd is actually running on the host or not. Without forking a SysV init system would block at start time imo.

mariussturm commented 6 years ago

I have created this PR: https://github.com/Graylog2/graylog-ansible-role/pull/87 With these changes MongoDB was installed successfully on CentOS7 with

SELINUX=enforcing
SELINUXTYPE=targeted

Regression tested with Ubuntu 16.04 and Debian 8

Couls someone please test the changes so that we can merge them?

mariussturm commented 6 years ago

Closing in favour of https://github.com/Graylog2/graylog-ansible-role/pull/87#issuecomment-378901786