[lxc-devel] Restarting snmp service on the host, shutdown snmp on the guest.

Michael Tokarev mjt at tls.msk.ru
Thu Jan 20 16:57:21 UTC 2011


[resending to the correct address; lxc-users@ bounced]

On 20.01.2011 19:09, Jean-Philippe Menil wrote:
> Hi,
> 
> i've just found something that is being anoying me:
> 
> when i restart the snmpd daemon on my host, it shutdown the snmpd daemon 
> on my container.

This, and many similar cases, happens - most likely - due to
bugs in system startup scripts on the host.

Host sees all processes running in the system, including all
the processes named "snmpd" running in all LXC containers.
What the startup script should do is to kill/restart only
the _proper_ process, - the one who's pid is listed in
host's /var/run/snmpd.pid.

> The host is a debian squeeze, with a 2.6.37 kernel, and the version 
> 0.7.3-1  packaged from debian.
> Guest are debian squeeze too.
[...]

> I see that, in debian, the init.d script for snmp contains the following
> stop)
>      echo -n "Stopping network management services:"
>      start-stop-daemon --quiet --stop --oknodo --exec /usr/sbin/snmpd
> 
> So it's not based on the pid of the process, but on the executable file.

Here we go.

> Is there a solution to bypass this problem, that i'm not aware of?

See above.  And file a bugreport against debian snmpd startup script.
It is actually (albiet very low) security issue too: the startup script
will kill unrelated user processes named "snmpd" too.

/mjt




More information about the lxc-devel mailing list