skaji / docker-monit

4 stars 1 forks source link

Any idea how to get of the defuncts? #2

Open zoobab opened 10 years ago

zoobab commented 10 years ago

It seems that monit produces at least one defunct process by ps it monitors.

Any idea how to remove them and/or avoid that they are created?

zoobab commented 10 years ago

I made a hack on how to get rid of defuncts processes, just chain supervisord and the monit in /etc/supervisord.conf:

[program:monit] command=/usr/bin/monit ; the program (relative uses PATH, can take args)

This is ugly but it works.

I also filed an issue on monit´s website:

https://bitbucket.org/tildeslash/monit/issue/53/monit-creates-a-lof-of-defunct-processes

phuongnd08 commented 9 years ago

What I do is to create monit.sh:

#!/usr/bin/env bash
monit -I -c $1

Then I just need to run monit.sh web-monit.conf. I can see that no defunct process created

shmilee commented 8 years ago

2 years?

What you need is a init for containers, for example, krallin/tini Dockerfile:

ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["/usr/bin/monit", "-I", "-c", "/etc/monitrc"]
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   4188   672 ?        Ss   16:53   0:00 /usr/bin/tini -- /usr/bin/moni
root         7  0.0  0.1  34028  4752 ?        Sl+  16:53   0:00 /usr/bin/monit -I -c /etc/moni
root        10  0.0  0.0  28288   800 ?        Ss   16:53   0:00 nginx: master process /usr/bin
http        11  0.0  0.0  28728  3140 ?        S    16:53   0:00 nginx: worker process