[OpenWrt-Devel] [PATCH procd 3/8] Fix curses applications to work with procd

Stam, Michel [FINT] M.Stam at fugro.nl
Fri Oct 3 11:23:05 EDT 2014


Hello Gert,

Good question.

What we discovered during an upgrade of our OpenWRT distribution (from a
fairly old one, I cannot exactly recall the version, I do recall it was
running kernel 2.6.22), was that suddenly our curses application did not
start anymore. And yes, for historical reasons, it was executed from the
inittab, no argument there.

I was looking into the reason and typing an answer to you, but I have to
look a little better as to the why. If you don't mind, I will get back
to you on Monday.

Kind regards,

Michel Stam

-----Original Message-----
From: Gert Doering [mailto:gert at greenie.muc.de] 
Sent: Friday, October 03, 2014 16:16 PM
To: Stam, Michel [FINT]
Cc: openwrt-devel at lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH procd 3/8] Fix curses applications
to work with procd

Hi,

On Thu, Oct 02, 2014 at 02:56:18PM +0200, Michel Stam wrote:
> The problem was caused by procd not opening /dev/tty* (which ever was 
> specified in /etc/inittab), causing /proc/PID/fd to point to /console 
> instead. /dev/console is a non-controlling tty (CTTY), and cannot be 
> used as one, which is exactly what curses applications want. Since 
> this is very likely to cause problems with other programs, procd now 
> opens /dev/tty? when the ID field of the inittab assigns one, and
forces this to be a CTTY.

I won't claim to understand the OpenWRT intricacies here, so take this
with a grain of salt.

In traditional unix systems, setting up a tty and acquiring a
controlling tty is getty's job, and not that of the init system - and
init should not start interactive programs (or "possibly interactive
programs") from /etc/inittab.

Changing this is fairly invasive into the way the system works and what
programs can expect regarding signal delivery etc. - like, someone
pressing ctrl-c on a tty, and a background process being started on that
tty will get a SIGINT (while it normally wouldn't).

Genuinely curious: can you explain a bit better in which cases this
change would be needed and/or beneficial?

thanks,

gert
--
USENET is *not* the non-clickable part of WWW!
 
//www.muc.de/~gert/
Gert Doering - Munich, Germany
gert at greenie.muc.de
fax: +49-89-35655025
gert at net.informatik.tu-muenchen.de
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list