Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watchdog workers/childs, fix systemd-restart on crash by exception #44

Merged
merged 7 commits into from
Sep 6, 2018

Conversation

dhoffend
Copy link
Contributor

This pull request takes care of multiple things

  1. no restart on crash (php exception) by systemd

When php throws an exception usually the returncode is 255. But when using set_exception_handler to handle internally the exception the exit code of cake.php script is always 0 even when crashes. This seems to be a cakephp related problem. If systemd restart mode is set to "always", systemd takes care on a crash (for example: when the database goes down)

  1. watch workers and restart them when needed

sometimes a worker can crash (database related stuff, exceptions or other external inputs). The main process should take care of this, handle SIGCHLD events and restart missing childs.

  1. when started via systemd the logout gets duplicated

per default statusengine_legacy logs per default to stdout and syslog. this duplicates the log in syslog (1x from systemd stdout, 1x statusengine syslog)

once set_exception_handler is set by cakephp, the return code
of the php script is always 0 unless set_exception_handler takes
care of it (which isn't the case). So if an exception is throw
systemd will not be able to restart of it's set on-failure
@nook24 nook24 changed the base branch from master to watchdog September 6, 2018 12:52
@nook24
Copy link
Owner

nook24 commented Sep 6, 2018

Hi @dhoffend, thanks for your PR.
I will merge this into the watchdog branch and take a look at it.

I will drop a notice here, if it got merged into master.

@nook24 nook24 merged commit c88df89 into nook24:watchdog Sep 6, 2018
@nook24 nook24 mentioned this pull request Sep 6, 2018
@nook24
Copy link
Owner

nook24 commented Sep 6, 2018

Done and released in 2.2.0: https://github.com/nook24/statusengine/releases/tag/2.2.0

@nook24
Copy link
Owner

nook24 commented Sep 6, 2018

I also implemented this to Statusengine 3 Worker: statusengine/worker#8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants