pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pkg/38101: pkgsrc - misc/screen failed to start on tty if BREAK is pending
>Number: 38101
>Category: pkg
>Synopsis: pkgsrc - misc/screen failed to start on tty if BREAK is pending
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Feb 25 09:40:00 +0000 2008
>Originator: Wolfgang Stukenbock
>Release: NetBSD 4.0 pkgsrc-2007Q4
>Organization:
Dr. Nagler & Company GmbH
>Environment:
System: NetBSD s010 4.0 NetBSD 4.0 (NSW-S010) #16: Wed Feb 20 12:51:34 CET 2008
wgstuken@s012:/export/NetBSD-4.0/N+C-build/.OBJDIR_amd64/export/NetBSD-4.0/src/sys/arch/amd64/compile/NSW-S010
amd64
Architecture: x86_64
Machine: amd64
>Description:
The package screen-4.0.3 failes to start on a tty when a break is
pending on that interface.
We are using screen as a console-multiplexer for the serial console of
several servers.
Screen will be started during system boot in detached mode from an
rc-file.
If in such case a break signal is pending on one of the interfaces
screen is gooing to open
during startup, screen will catch a SIGINT some milliseconds after
opening the affected
interface. At this time the SIGINT will terminate screen, so that it
will not come up.
Later - after startup has completed - screen will ignore SIGINT on the
interface, but that is too late ...
The problem can be "fixed" by turning the "brkint" flag off on such
interfaces. Accedently
the distribution does not allow to set the brkint flag while opening
the tty port.
Setting this flag by a "exec !.. stty -brkint" on the just created
window is too late,
screen will not come there - it dies before.
Therfore it makes sence to add the brkint to the flags recognized on
the creation command line.
Due to the fact that kern/28678 is still not fixed, the following patch
will also add support
to set vmin and vtime on the command line.
>How-To-Repeat:
No realy easy to reproduce ...
You need a machine and start screen during startup e.g. with
"/usr/pkg/bin/screen -m -d -S cons_screen -c /root/.cons_screenrc".
Than you need a permant pending BREAK signal on one tty-line - we have
had this situation on one
line of a cyclades card (cy - driver).
The rc-file (/root/.cons_screenrc) for screen should contain something
like
"screen -h 10000 -t s011 2 /dev/dtyCY004 38400,cs8,ixon,ixoff,-istrip"
"exec !.. stty min 1 time 0"
Remark: the second line is required as workaround for the bug reported
in kern/28678.
Whenn you boot the machine, screen tries to start, but will get SIGINT
and dies while setting up the window.
>Fix:
The following patch will add support to process vmin, vtime and
[-]brkint on the creation command line.
With this patch you can start the window with
"screen -h 10000 -t s011 2 /dev/dtyCY004
38400,cs8,ixon,ixoff,-istrip,-brkint,vmin=1,vtime=0"
without any problem.
Remark: this fix should work on any architecture screen supports. This
assumes that "m->tio.c_cc" is present
on all architectures, but the screen implemantation assumes this too as
fare as I've seen.
I've send this info to "screen%uni-erlangen.de@localhost" too. This
address is noted as the bug-report address in
the doku files of screen.
Start of Patch for tty.sh:
--- tty.sh.orig 2008-02-25 09:32:06.000000000 +0100
+++ tty.sh 2008-02-25 09:45:41.000000000 +0100
@@ -743,6 +743,22 @@
m->tio.c_cflag &= ~CRTSCTS;
#endif
}
+ else if (!strncmp("brkint", opt, 6))
+ {
+IF{BRKINT} m->tio.c_iflag |= BRKINT;
+ }
+ else if (!strncmp("-brkint", opt, 7))
+ {
+IF{BRKINT} m->tio.c_iflag &= ~BRKINT;
+ }
+ else if (!strncmp("vmin=", opt, 5) && opt[5] >= '0' && opt[5] <= '9')
+ {
+ m->tio.c_cc[VMIN] = atoi(&opt[5]) & 0xff;
+ }
+ else if (!strncmp("vtime=", opt, 6) && opt[6] >= '0' && opt[6] <= '9')
+ {
+ m->tio.c_cc[VTIME] = atoi(&opt[6]) & 0xff;
+ }
else
return -1;
while (*opt && !index(sep, *opt)) opt++;
>Unformatted:
Home |
Main Index |
Thread Index |
Old Index