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

Stam, Michel [FINT] M.Stam at fugro.nl
Mon Oct 6 08:07:29 EDT 2014


Hello Gert,

After looking through the documentation and code here, I found why I
implemented it this way;
Several months ago we had, as mentioned before, a problem getting curses
applications to start on a new version of OpenWRT. This manifested in
applications not starting at all, or not accepting any input from STDIN,
but otherwise outputing to STDOUT quite nicely.

I then started by checking the init.c of the busybox that was used with
the older OpenWRT, I believe this was busybox 1.4. This version of
busybox did the ioctl I did, and as I was under time pressure,
it-worked-for-me, and I added the patch.

After your comment, I looked into this a little deeper, found that the
ioctl was not really necessary, and removed it. It has since been
removed from busybox init.c too, which only helped to convince me. I
will submit this revised patch on the mailing list in a few minutes.

Thanks for the remark.

Kind regards,

Michel Stam

-----Original Message-----
From: openwrt-devel [mailto:openwrt-devel-bounces at lists.openwrt.org] On
Behalf Of Stam, Michel [FINT]
Sent: Friday, October 03, 2014 17:23 PM
To: Gert Doering
Cc: openwrt-devel at lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH procd 3/8] Fix curses applications
towork with procd

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
_______________________________________________
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