LXC "pct enter" hangs on pipe , ok with lxc-attach

javyer

Renowned Member
Nov 17, 2010
8
0
66
Hello ,

I have some strange behaviour using "lxc enter VMID" command.
I use this command to generate passwords into a bash script : "cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 20 | head -n 1"
This works on almost any machine, but not into an "lxc enter" session. This command justs freeze the script.
A simple work arround is to use "lxc-attach --name VMID"
I have tested on various nodes and VMs distros, with same result.
Here is the version of my nodes:
pve-manager/5.2-6/bcd5f008 (running kernel: 4.15.17-3-pve)
ii pve-container 2.0-24 all Proxmox VE Container management tool

If you just "cat /dev/urandom | head -c2" you got a broken pipe, why ?

Thanks
 
Apparently neither lxc-attach nor the shell entered in the container perform any kind of reset on the signal mask here. In some templates this does seem to happen. `pct` ignores SIGPIPE, lxc-attach leaves it as it is, as does your container's shell. The result is that instead of being killed, `cat`'s write() syscall simply returns an error (EPIPE).
We should probably have pct reset this before executing lxc-attach.
 
Nice, it would be corrected on a new pve-container package version ? ;-)
Or if you have a patch i can test it.


Regards
 

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!