[lxc-devel] Restarting snmp service on the host, shutdown snmp on the guest.
Jean-Philippe Menil
jean-philippe.menil at univ-nantes.fr
Thu Jan 20 16:09:28 UTC 2011
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.
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.
On the host:
root at suntory:~# ps aux | grep snmp
snmp 11747 0.0 0.0 42768 4948 ? S 16:52 0:00
/usr/sbin/snmpd -LS6d -Lf /dev/null -u snmp -I -smux -p
/var/run/snmpd.pid 172.20.6.33
snmp 11752 0.0 0.0 42728 4936 ? S 16:52 0:00
/usr/sbin/snmpd -LS6d -Lf /dev/null -u snmp -I -smux -p
/var/run/snmpd.pid 172.26.0.56
snmp 11804 0.0 0.0 42724 4932 ? S 16:54 0:00
/usr/sbin/snmpd -LS6d -Lf /dev/null -u snmp -I -smux -p
/var/run/snmpd.pid 172.26.0.51
snmp 11820 0.0 0.0 42840 4936 ? S 16:54 0:00
/usr/sbin/snmpd -LS6d -Lf /dev/null -u snmp -I -smux -p
/var/run/snmpd.pid 172.26.0.46
snmp 11873 0.0 0.0 42612 4592 ? S 16:55 0:00
/usr/sbin/snmpd -LS6d -Lf /dev/null -u snmp -I -smux -p
/var/run/snmpd.pid 172.26.0.21
root 12789 0.0 0.0 9660 840 pts/5 S+ 17:02 0:00 grep snmp
root at suntory:~# /etc/init.d/snmpd restart
Restarting network management services: snmpd.
root at suntory:~# ps aux | grep snmp
snmp 12800 1.0 0.0 42612 4552 ? S 17:03 0:00
/usr/sbin/snmpd -LS6d -Lf /dev/null -u snmp -I -smux -p
/var/run/snmpd.pid 172.20.6.33
root 12802 0.0 0.0 9660 840 pts/5 S+ 17:03 0:00 grep snmp
root at suntory:~#
Where the host, is the one with the 172.20.6.33 ip address.
Here is config file of a guest:
lxc.utsname = ***container-name***
lxc.tty = 4
lxc.pts = 1024
lxc.rootfs = /var/lib/lxc/***container-name***/rootfs
## Restrict capabilities
lxc.cap.drop = audit_control audit_write fsetid ipc_lock ipc_owner lease
linux_immutable mac_admin mac_override mac_admin mknod setfcap setpcap
sys_admin sys_boot sys_module sys_nice sys_pacct sys_ptrace sys_rawio
sys_resource sys_time sys_tty_config
lxc.cgroup.devices.deny = a
# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:1 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
lxc.cgroup.devices.allow = c 4:0 rwm
lxc.cgroup.devices.allow = c 4:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rwm
# mounts point
lxc.mount.entry=proc /var/lib/lxc/***container-name***/rootfs/proc proc
nodev,noexec,nosuid 0 0
lxc.mount.entry=devpts /var/lib/lxc/***container-name***/rootfs/dev/pts
devpts defaults 0 0
lxc.mount.entry=sysfs /var/lib/lxc/***container-name***/rootfs/sys sysfs
defaults 0 0
lxc.mount.entry=tmpfs /var/lib/lxc/***container-name***/rootfs/dev/shm
tmpfs defaults 0 0
#### network
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = **bridge**
lxc.network.name = eth0
lxc.network.mtu = 1500
lxc.network.hwaddr = XX:XX:XX:XX:XX:XX
lxc.network.veth.pair = letu2-lmb-clus
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.
Is there a solution to bypass this problem, that i'm not aware of?
Many thanks.
Regards.
More information about the lxc-devel
mailing list