sysvinit-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sysvinit-devel] Re: Bug#584102: startpar: Fail if fd 0 is strange tty


From: Dr. Werner Fink
Subject: [sysvinit-devel] Re: Bug#584102: startpar: Fail if fd 0 is strange tty
Date: Mon, 7 Jun 2010 17:13:11 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Mon, Jun 07, 2010 at 04:49:39PM +0200, Petter Reinholdtsen wrote:
> [Dr. Werner Fink]
> > That is a guess but nevertheless the attributes are used to set them
> > also to the pty/tty pairs used for parallel boot.  As stdout of
> > startpar can be used for a shell script parser (without option -M)
> > the stdio was guessed to be a real tty.
> 
> Right.
> 
> Any idea how to get parallel booting working also when stdin and
> stdout is a pipe, like it is with OpenVZ at the moment?

Hmmm ... stderr maybe, something like

  FILE* io[3];
  int notty = 1;

  io[0] = stdin;
  io[1] = stdout;
  io[2] = stderr;
  io[3] = NULL;

  for (n=0; io[n]; n++) {
    int fd = isatty(fileno(io[n]));
    if (tcgetattr(fd, &tio) == 0) {
        notty = 0
        break;
    }
  }

could work.

Btw: I've lost your mail

 Alternative startpar implementation - live-net-startpar

please resend.  Beside any startpar it could be an option
to use a directory based boot scheme as insserv aloready
uses a tsort which can be mapped on `directory' based
sorting scheme.  Could work simliar like the process_path()
routine of simpleinit ;)

     Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr



reply via email to

[Prev in Thread] Current Thread [Next in Thread]