[Users] cat /dev/urandom | head hangs in OVZ 7 CT
jjs - mainphrame
jjs at mainphrame.com
Thu Jan 11 21:58:59 MSK 2018
I was running the setup script for a program in a new OVZ7 Centos CT, and
it hung forever.
The line where it hung was this:
password=`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1`
I ran the following command in various environments:
time cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
In an ordinary physical host, a VM, an OVZ host, and in an LXD container,
the results are as follows:
root at akita:~# time cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 |
head -n 1
EozLZFPO0nu9UXR77LR6veKodVT9vYNW
real 0m0.008s
user 0m0.003s
sys 0m0.004s
root at akita:~#
But in any OVZ 7 CT, the following occurs:
root at dbserv:~# time cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 |
head -n 1
YtdP0ZUlfNKX1Vlh0VaBVZmO894HbsEp
< hang indefinitely, or until CTRL-C>
^C
real 4m36.571s
user 1m54.928s
sys 4m51.873s
root at dbserv:~#
Interestingly, the problem does not seem to be with /dev/urandom, as the
output is generated immediately. But the process does not end after being
piped into 'head -1'.
So, for whatever reason, the behavior of this one liner is very different
inside an OVZ 7 CT than it is anywhere else.
Your thoughts?
Jake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/users/attachments/20180111/c5573e64/attachment.html>
More information about the Users
mailing list