Re: Services running on CT0 and VEs? [message #39165 is a reply to message #39156] |
Sat, 20 March 2010 20:50  |
|
It's pretty easy -- one should not kill the processes using the process name, because it relies on a false assumption that process name is unique to the software instance -- in facts it is not, and you'll clearly see that if you'd run two instances of apache or mysqld (which is not uncommon).
Therefore, most daemons and their initscripts work the following way -- then a daemon is started it saves its pid into a file, and then the initscript wants to stop the daemon (or make it reload its config, or do anything else like that), it uses the PID from the file. This is true for most services and definitely sshd and rsyslog from your list work this way (iptables is not a daemon and I do not know anything about denyhosts).
This is what puppet and puppet initscript should do -- save PID at start and use it to shutdown.
If this is absolutely impossible, then killproc should be modified to filter out processes not belonging to host system. This is pretty easy since each /proc/$PID/status have a field named envID: -- if its value is zero this means host system, otherwise it's a process from some container. My guess is such filtering can be implemented in one or at most 34 lines of shell, so it's not a big deal.
Kir Kolyshkin
|
|
|