reread /etc/pve/lxc/*.conf without ct restart

harvie

Well-Known Member
Apr 5, 2017
138
24
58
35
Hello, i've added these settings to CT config:

lxc.cgroup.devices.allow: c 10:200 rwm
lxc.hook.autodev: sh -c "modprobe tun; cd ${LXC_ROOTFS_MOUNT}/dev; mkdir net; mknod net/tun c 10 200; chmod 0666 net/tun"


now when i do pct shutdown <ctid>; pct start <ctid> then tun driver (and openvpn) starts working immediately. But i have some CTs that cannot be restarted because of availability reasons. i understand that i can do pct enter and execute all the commands from lxc.hook.autodev line manualy. But how do i make pve reload lxc.cgroup.devices.allow without container restart? is there something like pct reload <vmid> which would cause these settings to apply without restarting container?
 
Last edited:
what version of pve do you use? (pveversion -v)
afaics there is no 'pct restart' ?

edit: misread the bit about reload
 
what version of pve do you use? (pveversion -v)
afaics there is no 'pct restart' ?

Virtual Environment 4.4-18/ef2610e8
Sorry, i was actually doing shutdown followed by start. not sure why there's no restart. However that's not point. I am wondering how to give device permissions to container without restarting it (= having to shut down and restart all processes runing in that ct).
 
you need to do that manually using the cgroups sys interface from the hypervisor.