Keyboard input / init + questions

Jerome Martin tramjoe.merin at gmail.com
Sun Sep 26 14:29:16 PDT 2010


ok, will do.
But meanwhile I have checked sysvinit sources, and since the very first
release this code is in, so I assumed you have a workaround for this, but I
find it strange that it works, because not only init steal the tty when
starting, but it does so in a separate process every time it spawns a child
too....

if ((f = console_open(O_RDWR|O_NOCTTY)) >= 0) {
/* Take over controlling tty by force */
(void)ioctl(f, TIOCSCTTY, 1);
   dup(f);
   dup(f);
}
SETSIG(sa, SIGCHLD, SIG_DFL, SA_RESTART);
if ((pid = fork()) < 0) {
   initlog(L_VB, "cannot fork: %s",
strerror(errno));
exit(1);
}
if (pid > 0) {
/*
 * Ignore keyboard signals etc.
 * Then wait for child to exit.
 */
SETSIG(sa, SIGINT, SIG_IGN, SA_RESTART);
SETSIG(sa, SIGTSTP, SIG_IGN, SA_RESTART);
SETSIG(sa, SIGQUIT, SIG_IGN, SA_RESTART);

while ((rc = waitpid(pid, &st, 0)) != pid)
if (rc < 0 && errno == ECHILD)
break;

/*
 * Small optimization. See if stealing
 * controlling tty back is needed.
 */
pgrp = tcgetpgrp(f);
if (pgrp != getpid())
exit(0);

/*
 * Steal controlling tty away. We do
 * this with a temporary process.
 */
if ((pid = fork()) < 0) {
   initlog(L_VB, "cannot fork: %s",
strerror(errno));
exit(1);
}
if (pid == 0) {
setsid();
(void)ioctl(f, TIOCSCTTY, 1);
exit(0);
}


On Sun, Sep 26, 2010 at 11:26 PM, Ray Strode <halfline at gmail.com> wrote:

> Hi,
>
> > Is the debug logged saved somewhere ? Because with my setup copying it
> from
> > the console is going to be tedious...
> Yes, should be in /var/log/plymouth-debug.log
>
> alternatively you can just cat /dev/vcs1
>
> --Ray
>



-- 
Jérôme Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/plymouth/attachments/20100926/ffc759f6/attachment.html>


More information about the plymouth mailing list