Shutdown Old cgroupv1 Containers After Upgrade to 7.x?

uberdome

Member
Mar 19, 2019
25
1
23
I made a mistake on one of my individual nodes. I upgraded to PVE 7.1 while I still had an auto-starting old container on Ubuntu 16.04 which does not work with cgroupv2. That container now shows running, but I cannot stop it.

I rebuilt the container as a VM manually so I don't actually need this remaining container at all, but I still cannot seem to shut down and remove it.

What would be the appropriate method to do so?

I have tried:
  • Stop (can't lock file '/run/lock/lxc/pve-config-102.lock' - got timeout (500))
  • Shutdown (can't lock file '/run/lock/lxc/pve-config-102.lock' - got timeout (500))
  • pct shutdown 102 --forcestop (can't lock file '/run/lock/lxc/pve-config-102.lock' - got timeout)
  • pct enter 102, shutdown (System has not been booted with systemd as init system (PID 1). Can't operate.)
The fundamental problem appears to be with locking for most of these (can't lock file '/run/lock/lxc/pve-config-102.lock' - got timeout (500)). but I'm not sure what the next step would be.

Separately, is there a straightforward way to get a Ubuntu 16.04 container systemd to work with cgroupv2 instead of converting to VM?

Thank you, Chris
 
hi,

I rebuilt the container as a VM manually so I don't actually need this remaining container at all, but I still cannot seem to shut down and remove it.
since you don't need it anymore, you could just kill the process, and then edit the config file in /etc/pve/lxc/102.conf to remove the automatic boot. (onboot)

to kill the process you can do something like:
Code:
ps aux | grep 102 # make note of the process ID, should be 2nd from left next to the username
kill -9 123321 # change this with the process ID from above step
 
  • Like
Reactions: uberdome
hi,


since you don't need it anymore, you could just kill the process, and then edit the config file in /etc/pve/lxc/102.conf to remove the automatic boot. (onboot)

to kill the process you can do something like:
Code:
ps aux | grep 102 # make note of the process ID, should be 2nd from left next to the username
kill -9 123321 # change this with the process ID from above step

Would you advise which process you are suggesting to kill before modifying the autoboot parameter?

Code:
root       40241  0.0  0.0   4548  2168 ?        Ss   Jan16   0:29 /usr/bin/lxc-start -F -n 102
root       40433  0.0  1.0 363732 123364 ?       Ss   Jan16   0:27 task UPID:sfml-pve1:00009DF1:0002D25A:61E40056:vncproxy:102:root@pam:
root       40434  0.0  0.0  90076  6144 ?        S    Jan16   0:00 /usr/bin/termproxy 5900 --path /vms/102 --perm VM.Console -- /usr/bin/dtach -A /var/run/dtach/vzctlconsole102 -r winch -z lxc-console -n 102 -e -1
root       40438  0.0  0.0   2216   592 pts/0    Ss+  Jan16   0:00 /usr/bin/dtach -A /var/run/dtach/vzctlconsole102 -r winch -z lxc-console -n 102 -e -1
root       40439  0.0  0.0   2428  1488 ?        Ss   Jan16   0:00 /usr/bin/dtach -A /var/run/dtach/vzctlconsole102 -r winch -z lxc-console -n 102 -e -1
root       40440  0.0  0.0   4544  1888 pts/1    Ss+  Jan16   0:00 lxc-console -n 102 -e -1
root      332337  0.0  1.0 363764 123516 ?       Ss   Jan16   0:00 task UPID:sfml-pve1:00051231:001BFD6B:61E440C4:vzshutdown:102:root@pam:
 
root 40241 0.0 0.0 4548 2168 ? Ss Jan16 0:29 /usr/bin/lxc-start -F -n 102 this one with lxc-start and the container ID in it
 
@oguz thank you very much. That successfully killed the process, and I was able to change the autoboot parameter as suggested. I rebooted the hypervisor and removed the offending containers.
 
Last edited:
  • Like
Reactions: oguz

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!