<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 05/22/2013 05:24 AM, Csiszár Tamás
wrote:<br>
</div>
<blockquote cite="mid:519CB8E3.2010604@virtual-call-center.eu"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Hi,<br>
<br>
I have a strange error on one of our servers when I use vzctl.
There's a running host with a few VE-s and if I type <i>vzctl
enter "CTID"</i> then I receive <i>enter into CT "CTID" failed</i>
and no further messages. After a lot of debugging I realized that
it works if I directly connect via the server's console, but if I
login via ssh it gives the error.<br>
The system parameters:<br>
OS: CentOS release 6.4<br>
Kernel: Linux vm4 2.6.32-042stab078.10 #1 SMP Wed May 8 19:45:03
MSK 2013 x86_64 x86_64 x86_64 GNU/Linux <br>
vzctl: vzctl-core-4.2-1.el6.x86_64<br>
vzctl-4.2-1.el6.x86_64<br>
<br>
I've tried to reboot the system with different kernels, but the
same error. There's another strange thing: we have another machine
with the same kernel but I cannot reproduce the error there.<br>
I've also tried to run vzctl with gdb and search in the source
code, and there seems to be a problem around setting up the
environment:<br>
In src/lib/hooks_vz.c there's a function:<br>
<br>
<i>static int vz_env_create_ioctl(vps_handler *h, envid_t veid,
int flags)</i><i><br>
</i><i>{</i><i><br>
</i><i> struct vzctl_env_create env_create;</i><i><br>
</i><i> int errcode;</i><i><br>
</i><i> int retry = 0;</i><i><br>
</i><i><br>
</i><i> memset(&env_create, 0, sizeof(env_create));</i><i><br>
</i><i> env_create.veid = veid;</i><i><br>
</i><i> env_create.flags = flags;</i><i><br>
</i><i> do {</i><i><br>
</i><i> if (retry)</i><i><br>
</i><i> sleep(1);</i><i><br>
</i><i> errcode = ioctl(h->vzfd,
VZCTL_ENV_CREATE, &env_create);</i><i><br>
</i><i> fprintf(stderr,"error code: %d\n",errcode);</i><i><br>
</i><i> } while (errcode < 0 && errno == EBUSY
&& retry++ < ENVRETRY);</i><i><br>
</i><i> if (errcode >= 0 && (flags &
VE_ENTER)) {</i><i><br>
</i><i> /* Clear supplementary group IDs */</i><i><br>
</i><i> setgroups(0, NULL);</i><i><br>
</i><i> /* Set personality PER_LINUX32 for i386
based CTs */</i><i><br>
</i><i> set_personality32();</i><i><br>
</i><i> }</i><i><br>
</i><i> else{</i><i><br>
</i><i>
fprintf(stderr,"%s,%d\n",strerror(errno),errno);</i><i><br>
</i><i> }</i><i><br>
</i><i> return errcode;</i><i><br>
</i><i>}</i><br>
<br>
The ioctl returns with an error: INVALID ARG. Also the vzct
start/stop don't work.<br>
I compared the two host's environment variables, but no
difference.<br>
<br>
</blockquote>
<br>
Hmm, looks weird.<br>
<br>
The fact that it works from console and doesn't work from ssh is
interesting. Maybe you should compare your environment from console
and ssh.<br>
<br>
If you want I can take a look, email me privately.<br>
</body>
</html>