Your message dated Sun, 15 Dec 2013 12:41:30 +0000 with message-id <[email protected]> and subject line Bug#671342: Removed package(s) from unstable has caused the Debian Bug report #75779, regarding openvt -w -s broken, console switch back fails to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact [email protected] immediately.) -- 75779: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=75779 Debian Bug Tracking System Contact [email protected] with problems
--- Begin Message ---Package: console-tools Version: 0.2.3-10.3 When I invoke `openvt' with -w and -s options, a new VT is open (as expected), but the expected program does not run, and the VT does not switch back to the original (calling) VT. The following example should open a new VT, print the date, wait 5 seconds, print the new date, and switch back to the originating VT. % openvt -v -s -w -- /bin/bash -c "/bin/date; sleep 5; /bin/date" using VT /dev/tty8 % Instead, the new VT is opened, and openvt exits without running the specified program, and without returning to the originating VT. After strace-ing and going through the sources, it seems that there are 2 fork()s (new process for new VT which spawns a new process for exec[lv]p), and 1 wait() in the first parent. The first child exit()s before the exec'd program (second child) has a chance to run to completion. This is a race condition where both child processes need to exit(), but the parent waits only for one, killing the remaining child. The second problem was in the switch-back area. The file descriptor for the console had already been closed, so the ioctl()s on the fd to perform a switch back returned with EBADF. I have a patch to propose that I have been testing on my installation: It adds a wait so the first child (new VT) can wait() for the second child (exec'd program). It also re-opens the file descriptor for the VT to perform the VT switch-back. --- console-tools-0.2.3-orig/vttools/openvt.c +++ console-tools-0.2.3/vttools/openvt.c @@ -330,6 +330,7 @@ else execvp(cmd, &argv[optind]); } + wait(NULL); _exit(127); /* exec failed */ } @@ -344,6 +345,13 @@ wait(NULL); if (show) /* Switch back... */ { + fd = get_console_fd(NULL); + if (fd < 0) + { + fprintf(stderr, + _("Could not get a file descriptor referring to the console\n")); + return(2); + } (void) ioctl(fd, VT_ACTIVATE, vtstat.v_active); /* wait to be really sure we have switched */ (void) ioctl(fd, VT_WAITACTIVE, vtstat.v_active); The new behavior for the above example is to switch to the new VT (/dev/tty8), print the date, wait 5 seconds, print the new date, and switch back to the original VT (the expected behavior). _____________________________ Stephen M. Benoit ___________________________ ~ ~ | [email protected] | B.Eng (Computer), M.Eng (Electrical) ('>') | Tel: +1 514 255-3550 | Service Providers of America INC _ | FAX: +1 514 256-1356 | Web page: http://www.MagnumLine.com/ _______|________________________|__________________________________________
--- End Message ---
--- Begin Message ---Version: 2:0.2.3-73+rm Dear submitter, as the package console-tools has just been removed from the Debian archive unstable we hereby close the associated bug reports. We are sorry that we couldn't deal with your issue properly. For details on the removal, please see http://bugs.debian.org/671342 The version of this package that was in Debian prior to this removal can still be found using http://snapshot.debian.org/. This message was generated automatically; if you believe that there is a problem with it please contact the archive administrators by mailing [email protected]. Debian distribution maintenance software pp. Joerg Jaspert (the ftpmaster behind the curtain)
--- End Message ---

