[Pkg-sysvinit-devel] Bug#584102: OpenVZ vzctl enter dying with: Unable to open pty: No such file or directory; problem with tcgetattr() and startpar

Petter Reinholdtsen pere at hungry.com
Fri Jun 4 12:42:51 UTC 2010


[Bartosz Pierzchala]
> stty -a doesn't output anything when it's being launched via init
> scripts at boot time. It exits with exit code 1.

Right.  So no tty available. :)

> The system boots properly with startpar enabled when call to
> tcgetattr() isn't a fatal error - as I've written before.

I tested, and output from scripts seem to be lost when tcgetattr()
wasn't working.  Anyway, if tcgetattr() fail, tcsetattr() will be
using bogus values when it try to set RAW mode on the tty, so it is
not enough to just disable tcgetattr().

To test this, a simple 'startpar /bin/ls /bin/ls' can be used.  This
work:

  /sbin/startpar /bin/ls /bin/ls

This do not work:

  cat /dev/null | /sbin/startpar /bin/ls /bin/ls

If the output from ls is missing, startpar is not working as it
should.

> Peter, perhaps we could briefly describe the variable in your patch?

I'm unable to understand your question, but suspect you ask for an
explanation of my patch.  It change startpar to run all scripts
sequencially if the tcgetattr() call fail, because the variable tio
set by tcgetattr() is only used when scripts are executed in parallel,
and thus it seemed safe to run scripts sequencially when it fail.

> From OpenVZ's vzctl sources I can see that output file descriptor is
> a pipe.

Thank you.  That explains the problem, yes.

> I'll ask OpenVZ developers on their forum if that could be changed
> to a pseudo terminal.

That would be nice, and should get a bunch of other boot scripts
working as well. :)

Anyway, if stdin is a pipe with OpenVZ, my proposed patch should work,
and I will prepare an upload with that fix in place.  Even better
would be to find a way to run the scripts in parallel also on OpenVZ,
but that will have to wait for later. :)

Happy hacking,
-- 
Petter Reinholdtsen





More information about the Pkg-sysvinit-devel mailing list