Docker Community Forums

Share and learn in the Docker community.

Nagios doesn't shutdown

docker

(Bluemind2005) #1

Hello Guys,

I had nagio image and all I did was run since then it is not shutting itself down.
jim@jim-Ubuntu1504:~$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest 94df4f0ce8a4 5 weeks ago 967 B
jasonrivers/nagios latest 0818f87bf051 3 months ago 647.7 MB
jim@jim-Ubuntu1504:~$ docker run 0

Even if I kill the pid It starts again.
root@jim-Ubuntu1504:~# ps -aef|grep nagio|grep -v grep
root 10128 9304 0 00:57 ? 00:00:00 runsv nagios
vboxadd 10129 10128 0 00:57 ? 00:00:00 /opt/nagios/bin/nagios /opt/nagios/etc/nagios.cfg
vboxadd 10130 10129 0 00:57 ? 00:00:00 /opt/nagios/bin/nagios --worker /opt/nagios/var/rw/nagios.qh
vboxadd 10131 10129 0 00:57 ? 00:00:00 /opt/nagios/bin/nagios --worker /opt/nagios/var/rw/nagios.qh
vboxadd 10132 10129 0 00:57 ? 00:00:00 /opt/nagios/bin/nagios --worker /opt/nagios/var/rw/nagios.qh
vboxadd 10133 10129 0 00:57 ? 00:00:00 /opt/nagios/bin/nagios --worker /opt/nagios/var/rw/nagios.qh
vboxadd 10134 10129 0 00:57 ? 00:00:00 /opt/nagios/bin/nagios /opt/nagios/etc/nagios.cfg
root@jim-Ubuntu1504:~#

root@jim-Ubuntu1504:~# ps -aef|grep nagio|grep -v grep|awk ‘{print $2}’|xargs kill
root@jim-Ubuntu1504:~# ps -aef|grep nagio|grep -v grep
vboxadd 10134 9304 0 00:57 ? 00:00:00 [nagios]
root@jim-Ubuntu1504:~# ps -aef|grep nagio|grep -v grep
root 10356 9304 0 01:05 ? 00:00:00 runsv nagios
vboxadd 10357 10356 0 01:05 ? 00:00:00 /opt/nagios/bin/nagios /opt/nagios/etc/nagios.cfg
vboxadd 10358 10357 0 01:05 ? 00:00:00 /opt/nagios/bin/nagios --worker /opt/nagios/var/rw/nagios.qh
vboxadd 10359 10357 0 01:05 ? 00:00:00 /opt/nagios/bin/nagios --worker /opt/nagios/var/rw/nagios.qh
vboxadd 10360 10357 0 01:05 ? 00:00:00 /opt/nagios/bin/nagios --worker /opt/nagios/var/rw/nagios.qh
vboxadd 10361 10357 0 01:05 ? 00:00:00 /opt/nagios/bin/nagios --worker /opt/nagios/var/rw/nagios.qh
vboxadd 10362 10357 0 01:05 ? 00:00:00 /opt/nagios/bin/nagios /opt/nagios/etc/nagios.cfg
root@jim-Ubuntu1504:~#

Don’t know how to stop this daemon.

How to do I run it in background?

I want it to monitor my host.

Any help would be appreciated.


(David Maze) #2

docker stop?

docker run -d?

I don’t know what’s inside that image, but the runsv in the ps output suggests to me that it might be running something like a supervisord, which would restart the daemon if somehow it died. You’ll probably find it a little easier to use the Docker-native tools (docker ps is the other big one I haven’t mentioned) to manage the container lifecycle than to directly try to deal with the processes inside the container.

The next logical question from your post would be, what’s host pid 9304?


(Bluemind2005) #3

Yes mate what is the pid ! ? :slight_smile:
I would like to understand more of supervisord format of the daemon is that to do with Unix itself? Its interesting thing to explore and understand further.

Yep, docker run -d does the magic.

If you don’t use you lose, started studying after few months and all knowledge of docker seems to be evaporated :worried:

Many thanks again for your response !