Monit creates a lof of defunct processes if it is launched as PID1
repeating the closed issueof the same name, since cannot reopen it.
- The use case for Monit as init replacement is monit running inside docker container.
- Docker container may only start 1 process.
- If you want more, then that process should start others.
- This is a perfect use case for Monit, but like noted in this thread it creates a lot of zombie processes, which is a problem.
- Can this issue be reopened?
Comments (9)
-
repo owner -
reporter thanks. While at it, could you check this question as well (I'm on a phone, will try to create an issue later)
-
Does "will be done later this year" still apply? ;-)
-
repo owner Issue
#229was marked as a duplicate of this issue. -
I've created a pull request #34 which I think should also fix this issue, although we are not running monit as pid 1.
-
@dbabits I had a similar problem when I was using monit as pid 1 inside my docker. I used tini which is zombie reaper, here is the link to it https://github.com/krallin/tini. So tini becomes your entrypoint which calls the existing entrypoint.
-
I know we can use dump-init or tini, but is this already planned?
-
repo owner It is on our roadmap. This requires quite a bit of work and a rewrite of core parts of Monit. We are very motivated to do this, but unfortunately haven't found the time yet. In the meantime we recommend the solutions already mentioned in this thread.
-
Thank you for the update!
- Log in to comment
We'll keep this issue open until fixed. We agree that it would be great if Monit can replace
init
inDocker
and in other virtual containers. Unfortunately, this is not possible now as Monit requires an init-like parent process to reap orphaned children. The changes required in Monit is straightforward though; replace the existing scheduler with a new, based on an event-loop and modify Monit's dependency implementation. This require some work and will be done later this year.