Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

<< WAIT >>


devel / comp.unix.programmer / Re: Question on implementation of /dev/pts

SubjectAuthor
* Question on implementation of /dev/ptsKenny McCormack
+* Question on implementation of /dev/ptsMuttley
|`* Question on implementation of /dev/ptsNicolas George
| +* Question on implementation of /dev/ptsScott Lurndal
| |+* Question on implementation of /dev/ptsNicolas George
| ||`- Question on implementation of /dev/ptsScott Lurndal
| |`* Question on implementation of /dev/ptsMuttley
| | +- Question on implementation of /dev/ptsScott Lurndal
| | +* Question on implementation of /dev/ptsScott Lurndal
| | |`* Question on implementation of /dev/ptsMuttley
| | | `* Question on implementation of /dev/ptsScott Lurndal
| | |  `- Question on implementation of /dev/ptsMuttley
| | `* Question on implementation of /dev/ptsHelmut Waitzmann
| |  `- Question on implementation of /dev/ptsScott Lurndal
| +- Question on implementation of /dev/ptsKaz Kylheku
| `- Question on implementation of /dev/ptsMuttley
+- Question on implementation of /dev/ptsScott Lurndal
`- Question on implementation of /dev/ptsKaz Kylheku

1
Question on implementation of /dev/pts

<ta6tpc$2hsfs$1@news.xmission.com>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2776&group=comp.unix.programmer#2776

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.unix.programmer
Subject: Question on implementation of /dev/pts
Date: Thu, 7 Jul 2022 15:23:24 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <ta6tpc$2hsfs$1@news.xmission.com>
Injection-Date: Thu, 7 Jul 2022 15:23:24 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2683388"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Thu, 7 Jul 2022 15:23 UTC

We know that if you log in on a given pts - say, /dev/pts/27 - and then
start background some process, then log off, the background process will
(still) have /dev/pts/27 open. Yet, when you log out, that file
(/dev/pts/27) will (usually) be deleted (i.e., no longer present in
/dev/pts). However, since the background process still has it open, it
cannot be re-used (until said background process either closes it or exits).

When you look in /proc/<pid>/fd, you see that /dev/pts/27 is open (but is
listed as "deleted").

So, my question is: Why bother to delete it if it is still in use (and
can't be re-used)? (Remember, this is a question about the implementation;
I'm not talking about any user-space process deleting anything). Why not
delete it only after all processes have closed it (so that it can then be
re-used)?

My guess is that it gets deleted because the system detects that it is no
longer the "control terminal" of any process. But, as I've argued above,
this seems actually counter-productive. Is there any reason for it to be
this way?

--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/ItsTough

Re: Question on implementation of /dev/pts

<ta6vfq$16rg$1@gioia.aioe.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2777&group=comp.unix.programmer#2777

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!BKzeqmo2UYxb4eR2zKm0zw.user.46.165.242.75.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: Question on implementation of /dev/pts
Date: Thu, 7 Jul 2022 15:52:26 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <ta6vfq$16rg$1@gioia.aioe.org>
References: <ta6tpc$2hsfs$1@news.xmission.com>
Injection-Info: gioia.aioe.org; logging-data="39792"; posting-host="BKzeqmo2UYxb4eR2zKm0zw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Muttley@dastardlyhq.com - Thu, 7 Jul 2022 15:52 UTC

On Thu, 7 Jul 2022 15:23:24 -0000 (UTC)
gazelle@shell.xmission.com (Kenny McCormack) wrote:
>We know that if you log in on a given pts - say, /dev/pts/27 - and then
>start background some process, then log off, the background process will
>(still) have /dev/pts/27 open. Yet, when you log out, that file
>(/dev/pts/27) will (usually) be deleted (i.e., no longer present in
>/dev/pts). However, since the background process still has it open, it
>cannot be re-used (until said background process either closes it or exits).
>
>When you look in /proc/<pid>/fd, you see that /dev/pts/27 is open (but is
>listed as "deleted").
>
>So, my question is: Why bother to delete it if it is still in use (and
>can't be re-used)? (Remember, this is a question about the implementation;
>I'm not talking about any user-space process deleting anything). Why not
>delete it only after all processes have closed it (so that it can then be
>re-used)?
>
>My guess is that it gets deleted because the system detects that it is no
>longer the "control terminal" of any process. But, as I've argued above,
>this seems actually counter-productive. Is there any reason for it to be
>this way?

Presumably you're referring to Linux in which case its probably another
"feature" of systemd rather than the kernel itself and looking for logic in
a lot of Poetterings decisions can be a waste of time.

Re: Question on implementation of /dev/pts

<gNDxK.292976$ssF.101759@fx14.iad>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2778&group=comp.unix.programmer#2778

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx14.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Question on implementation of /dev/pts
Newsgroups: comp.unix.programmer
References: <ta6tpc$2hsfs$1@news.xmission.com>
Lines: 31
Message-ID: <gNDxK.292976$ssF.101759@fx14.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 07 Jul 2022 16:24:44 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 07 Jul 2022 16:24:44 GMT
X-Received-Bytes: 2142
 by: Scott Lurndal - Thu, 7 Jul 2022 16:24 UTC

gazelle@shell.xmission.com (Kenny McCormack) writes:
>We know that if you log in on a given pts - say, /dev/pts/27 - and then
>start background some process, then log off, the background process will
>(still) have /dev/pts/27 open. Yet, when you log out, that file
>(/dev/pts/27) will (usually) be deleted (i.e., no longer present in
>/dev/pts). However, since the background process still has it open, it
>cannot be re-used (until said background process either closes it or exits).
>
>When you look in /proc/<pid>/fd, you see that /dev/pts/27 is open (but is
>listed as "deleted").
>
>So, my question is: Why bother to delete it if it is still in use (and
>can't be re-used)? (Remember, this is a question about the implementation;
>I'm not talking about any user-space process deleting anything). Why not
>delete it only after all processes have closed it (so that it can then be
>re-used)?

If the the controlling terminal master (e.g. xterm) exits, the
slave side of the pseudo terminal cannot be subsequently opened, so
the pts kernel driver removes it from the 'devpts' pseudo file system (on
linux - SysV doesn't have a devpts pfs, so they don't remove the
entries in the /dev/pts subdirectory).

Accesses to the slave side by orphaned processes in the session or process
group(s) associated with the former master terminal will receive
EIO errors.

$ mount | grep pts
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000)

Sorry muttley, it has nothing to do with systemd.

Re: Question on implementation of /dev/pts

<62c709d3$0$8518$426a74cc@news.free.fr>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2779&group=comp.unix.programmer#2779

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!paganini.bofh.team!pasdenom.info!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!cleanfeed3-b.proxad.net!nnrp1-1.free.fr!not-for-mail
Newsgroups: comp.unix.programmer
From: nicolas$george@salle-s.org (Nicolas George)
Subject: Re: Question on implementation of /dev/pts
Sender: george@phare.invalid (Nicolas George)
X-Newsreader: Flrn (0.9.20070704)
References: <ta6tpc$2hsfs$1@news.xmission.com> <ta6vfq$16rg$1@gioia.aioe.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1
Date: 07 Jul 2022 16:29:07 GMT
Lines: 9
Message-ID: <62c709d3$0$8518$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 07 Jul 2022 18:29:07 CEST
NNTP-Posting-Host: 129.199.129.80
X-Trace: 1657211347 news-1.free.fr 8518 129.199.129.80:52690
X-Complaints-To: abuse@proxad.net
 by: Nicolas George - Thu, 7 Jul 2022 16:29 UTC

Muttley@dastardlyhq.com, dans le message <ta6vfq$16rg$1@gioia.aioe.org>,
a écrit :
> Presumably you're referring to Linux in which case its probably another
> "feature" of systemd rather than the kernel itself and looking for logic in
> a lot of Poetterings decisions can be a waste of time.

/dev/pts has nothing to do with systemd, it predates it by many years.

You should be careful, hate twists your reasoning.

Re: Question on implementation of /dev/pts

<N3ExK.426622$X_i.362259@fx18.iad>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2780&group=comp.unix.programmer#2780

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx18.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Question on implementation of /dev/pts
Newsgroups: comp.unix.programmer
References: <ta6tpc$2hsfs$1@news.xmission.com> <ta6vfq$16rg$1@gioia.aioe.org> <62c709d3$0$8518$426a74cc@news.free.fr>
Lines: 21
Message-ID: <N3ExK.426622$X_i.362259@fx18.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 07 Jul 2022 16:44:29 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 07 Jul 2022 16:44:29 GMT
X-Received-Bytes: 1691
 by: Scott Lurndal - Thu, 7 Jul 2022 16:44 UTC

Nicolas George <nicolas$george@salle-s.org> writes:
>Muttley@dastardlyhq.com, dans le message <ta6vfq$16rg$1@gioia.aioe.org>,
> a �crit�:
>> Presumably you're referring to Linux in which case its probably another
>> "feature" of systemd rather than the kernel itself and looking for logic in
>> a lot of Poetterings decisions can be a waste of time.
>
>/dev/pts has nothing to do with systemd, it predates it by many years.
>
>You should be careful, hate twists your reasoning.

To the extent that systems exist without the 'devpts' pseudo filesystem,
they use 'udev' to manage dynamic changes to the /dev hierarchy. I
wouldn't be surprised if systemd has absorbed that functionality
(and indeed, it appears that udev was absorbed by systemd a decade ago).

On systems with the 'devpts' pfs, the pfs will remove the entry
when it is no longer useful (i.e. if/when the master side is closed).

In either case, since the /dev/pts entry cannot be used after the
master is closed, it makes no sense to keep it around.

Re: Question on implementation of /dev/pts

<62c70dca$0$9152$426a74cc@news.free.fr>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2781&group=comp.unix.programmer#2781

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed3-b.proxad.net!nnrp1-1.free.fr!not-for-mail
Newsgroups: comp.unix.programmer
From: nicolas$george@salle-s.org (Nicolas George)
Subject: Re: Question on implementation of /dev/pts
Sender: george@phare.invalid (Nicolas George)
X-Newsreader: Flrn (0.9.20070704)
References: <ta6tpc$2hsfs$1@news.xmission.com> <ta6vfq$16rg$1@gioia.aioe.org> <62c709d3$0$8518$426a74cc@news.free.fr> <N3ExK.426622$X_i.362259@fx18.iad>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1
Date: 07 Jul 2022 16:46:02 GMT
Lines: 7
Message-ID: <62c70dca$0$9152$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 07 Jul 2022 18:46:02 CEST
NNTP-Posting-Host: 129.199.129.80
X-Trace: 1657212362 news-2.free.fr 9152 129.199.129.80:33898
X-Complaints-To: abuse@proxad.net
 by: Nicolas George - Thu, 7 Jul 2022 16:46 UTC

Scott Lurndal, dans le message <N3ExK.426622$X_i.362259@fx18.iad>, a
écrit :
> On systems with the 'devpts' pfs, the pfs will remove the entry
> when it is no longer useful (i.e. if/when the master side is closed).

Since it is a virtual file system, there is no removal at all: the
filessytem just translates the internal tables of the kernel.

Re: Question on implementation of /dev/pts

<7vExK.426624$X_i.425405@fx18.iad>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2782&group=comp.unix.programmer#2782

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx18.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Question on implementation of /dev/pts
Newsgroups: comp.unix.programmer
References: <ta6tpc$2hsfs$1@news.xmission.com> <ta6vfq$16rg$1@gioia.aioe.org> <62c709d3$0$8518$426a74cc@news.free.fr> <N3ExK.426622$X_i.362259@fx18.iad> <62c70dca$0$9152$426a74cc@news.free.fr>
Lines: 11
Message-ID: <7vExK.426624$X_i.425405@fx18.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Thu, 07 Jul 2022 17:13:39 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Thu, 07 Jul 2022 17:13:39 GMT
X-Received-Bytes: 1241
 by: Scott Lurndal - Thu, 7 Jul 2022 17:13 UTC

Nicolas George <nicolas$george@salle-s.org> writes:
>Scott Lurndal, dans le message <N3ExK.426622$X_i.362259@fx18.iad>, a
> �crit�:
>> On systems with the 'devpts' pfs, the pfs will remove the entry
>> when it is no longer useful (i.e. if/when the master side is closed).
>
>Since it is a virtual file system, there is no removal at all: the
>filessytem just translates the internal tables of the kernel.

Removing from the internal table of the kernel "removes" it from
the filesystem. Semantics.

Re: Question on implementation of /dev/pts

<20220707175204.651@kylheku.com>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2783&group=comp.unix.programmer#2783

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: 480-992-1380@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: Question on implementation of /dev/pts
Date: Fri, 8 Jul 2022 00:54:00 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <20220707175204.651@kylheku.com>
References: <ta6tpc$2hsfs$1@news.xmission.com>
Injection-Date: Fri, 8 Jul 2022 00:54:00 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="6e03880fe7c30983e77d4a0822fd7f84";
logging-data="556972"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+i/rGHHsN7gQnyZgYufc9MaSOEuJuW1TU="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:wNALfYQBo6+mvuLnxw9zxVHK96c=
 by: Kaz Kylheku - Fri, 8 Jul 2022 00:54 UTC

On 2022-07-07, Kenny McCormack <gazelle@shell.xmission.com> wrote:
> My guess is that it gets deleted because the system detects that it is no
> longer the "control terminal" of any process. But, as I've argued above,
> this seems actually counter-productive. Is there any reason for it to be
> this way?

You know, you could be looking at some systemd fuckery.

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: Question on implementation of /dev/pts

<20220707175414.554@kylheku.com>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2784&group=comp.unix.programmer#2784

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: 480-992-1380@kylheku.com (Kaz Kylheku)
Newsgroups: comp.unix.programmer
Subject: Re: Question on implementation of /dev/pts
Date: Fri, 8 Jul 2022 00:55:17 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <20220707175414.554@kylheku.com>
References: <ta6tpc$2hsfs$1@news.xmission.com>
<ta6vfq$16rg$1@gioia.aioe.org> <62c709d3$0$8518$426a74cc@news.free.fr>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 8 Jul 2022 00:55:17 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="6e03880fe7c30983e77d4a0822fd7f84";
logging-data="556972"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+vaYZ71gQRpw8rHARq0NvPkJ1apJO16AE="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:KMrvQ6QbxR26lCRfagjUZa5A77w=
 by: Kaz Kylheku - Fri, 8 Jul 2022 00:55 UTC

On 2022-07-07, Nicolas George <nicolas$george@salle-s.org> wrote:
> Muttley@dastardlyhq.com, dans le message <ta6vfq$16rg$1@gioia.aioe.org>,
> a écrit :
>> Presumably you're referring to Linux in which case its probably another
>> "feature" of systemd rather than the kernel itself and looking for logic in
>> a lot of Poetterings decisions can be a waste of time.
>
> /dev/pts has nothing to do with systemd, it predates it by many years.

Your reasoning being what? That systemd wouldn't mess with anything that
predated it?

Don't you know that it handles udev events and messes with dev?

--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal

Re: Question on implementation of /dev/pts

<ta96i8$1rea$1@gioia.aioe.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2785&group=comp.unix.programmer#2785

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!BKzeqmo2UYxb4eR2zKm0zw.user.46.165.242.75.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: Question on implementation of /dev/pts
Date: Fri, 8 Jul 2022 12:05:29 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <ta96i8$1rea$1@gioia.aioe.org>
References: <ta6tpc$2hsfs$1@news.xmission.com> <ta6vfq$16rg$1@gioia.aioe.org> <62c709d3$0$8518$426a74cc@news.free.fr> <N3ExK.426622$X_i.362259@fx18.iad>
Injection-Info: gioia.aioe.org; logging-data="60874"; posting-host="BKzeqmo2UYxb4eR2zKm0zw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Muttley@dastardlyhq.com - Fri, 8 Jul 2022 12:05 UTC

On Thu, 07 Jul 2022 16:44:29 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
>Nicolas George <nicolas$george@salle-s.org> writes:
>>Muttley@dastardlyhq.com, dans le message <ta6vfq$16rg$1@gioia.aioe.org>,
>> a �crit�:
>>> Presumably you're referring to Linux in which case its probably another
>>> "feature" of systemd rather than the kernel itself and looking for logic in
>>> a lot of Poetterings decisions can be a waste of time.
>>
>>/dev/pts has nothing to do with systemd, it predates it by many years.
>>
>>You should be careful, hate twists your reasoning.
>
>To the extent that systems exist without the 'devpts' pseudo filesystem,
>they use 'udev' to manage dynamic changes to the /dev hierarchy. I
>wouldn't be surprised if systemd has absorbed that functionality
>(and indeed, it appears that udev was absorbed by systemd a decade ago).
>
>On systems with the 'devpts' pfs, the pfs will remove the entry
>when it is no longer useful (i.e. if/when the master side is closed).

An IPC link whether a pipe, fifo, message queue etc or a ptm/pts should not
be deleted until BOTH sides have closed the link.

>In either case, since the /dev/pts entry cannot be used after the
>master is closed, it makes no sense to keep it around.

If the slave process is still attached it could in theory wait for a new master.

Re: Question on implementation of /dev/pts

<ta96j8$1rfn$1@gioia.aioe.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2786&group=comp.unix.programmer#2786

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!BKzeqmo2UYxb4eR2zKm0zw.user.46.165.242.75.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: Question on implementation of /dev/pts
Date: Fri, 8 Jul 2022 12:06:00 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <ta96j8$1rfn$1@gioia.aioe.org>
References: <ta6tpc$2hsfs$1@news.xmission.com> <ta6vfq$16rg$1@gioia.aioe.org> <62c709d3$0$8518$426a74cc@news.free.fr>
Injection-Info: gioia.aioe.org; logging-data="60919"; posting-host="BKzeqmo2UYxb4eR2zKm0zw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Muttley@dastardlyhq.com - Fri, 8 Jul 2022 12:06 UTC

On 07 Jul 2022 16:29:07 GMT
Nicolas George <nicolas$george@salle-s.org> wrote:
>Muttley@dastardlyhq.com, dans le message <ta6vfq$16rg$1@gioia.aioe.org>,
> a �crit�:
>> Presumably you're referring to Linux in which case its probably another
>> "feature" of systemd rather than the kernel itself and looking for logic in
>> a lot of Poetterings decisions can be a waste of time.
>
>/dev/pts has nothing to do with systemd, it predates it by many years.
>
>You should be careful, hate twists your reasoning.

You need to learn about systemd and where its tentacles have reached.

Re: Question on implementation of /dev/pts

<MJWxK.34855$Eh2.8229@fx41.iad>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2787&group=comp.unix.programmer#2787

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx41.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Question on implementation of /dev/pts
Newsgroups: comp.unix.programmer
References: <ta6tpc$2hsfs$1@news.xmission.com> <ta6vfq$16rg$1@gioia.aioe.org> <62c709d3$0$8518$426a74cc@news.free.fr> <N3ExK.426622$X_i.362259@fx18.iad> <ta96i8$1rea$1@gioia.aioe.org>
Lines: 30
Message-ID: <MJWxK.34855$Eh2.8229@fx41.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 08 Jul 2022 13:58:04 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 08 Jul 2022 13:58:04 GMT
X-Received-Bytes: 2109
 by: Scott Lurndal - Fri, 8 Jul 2022 13:58 UTC

Muttley@dastardlyhq.com writes:
>On Thu, 07 Jul 2022 16:44:29 GMT
>scott@slp53.sl.home (Scott Lurndal) wrote:
>>Nicolas George <nicolas$george@salle-s.org> writes:
>>>Muttley@dastardlyhq.com, dans le message <ta6vfq$16rg$1@gioia.aioe.org>,
>>> a �crit�:
>>>> Presumably you're referring to Linux in which case its probably another
>>>> "feature" of systemd rather than the kernel itself and looking for logic in
>>>> a lot of Poetterings decisions can be a waste of time.
>>>
>>>/dev/pts has nothing to do with systemd, it predates it by many years.
>>>
>>>You should be careful, hate twists your reasoning.
>>
>>To the extent that systems exist without the 'devpts' pseudo filesystem,
>>they use 'udev' to manage dynamic changes to the /dev hierarchy. I
>>wouldn't be surprised if systemd has absorbed that functionality
>>(and indeed, it appears that udev was absorbed by systemd a decade ago).
>>
>>On systems with the 'devpts' pfs, the pfs will remove the entry
>>when it is no longer useful (i.e. if/when the master side is closed).
>
>An IPC link whether a pipe, fifo, message queue etc or a ptm/pts should not
>be deleted until BOTH sides have closed the link.

Technically, the PTM/PTS pair is not deleted until both sides have closed the link.

The directory entry for the slave is, however, removed when the master
side is closed. As it should be.

Re: Question on implementation of /dev/pts

<XLWxK.34856$Eh2.5862@fx41.iad>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2788&group=comp.unix.programmer#2788

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!rocksolid2!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx41.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Question on implementation of /dev/pts
Newsgroups: comp.unix.programmer
References: <ta6tpc$2hsfs$1@news.xmission.com> <ta6vfq$16rg$1@gioia.aioe.org> <62c709d3$0$8518$426a74cc@news.free.fr> <N3ExK.426622$X_i.362259@fx18.iad> <ta96i8$1rea$1@gioia.aioe.org>
Lines: 14
Message-ID: <XLWxK.34856$Eh2.5862@fx41.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 08 Jul 2022 14:00:23 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 08 Jul 2022 14:00:23 GMT
X-Received-Bytes: 1305
 by: Scott Lurndal - Fri, 8 Jul 2022 14:00 UTC

Muttley@dastardlyhq.com writes:
>On Thu, 07 Jul 2022 16:44:29 GMT
>scott@slp53.sl.home (Scott Lurndal) wrote:

>>In either case, since the /dev/pts entry cannot be used after the
>>master is closed, it makes no sense to keep it around.
>
>If the slave process is still attached it could in theory wait for a new master.
>

What theory is that? Pseudo terminal behavior is standardized by
the Open Group/POSIX specifications. /dev/ptm is a multiplexor
which 'creates' a new client side (pts) when opened. There is no
API to associate a new master with an existing PTS.

Re: Question on implementation of /dev/pts

<ta9iph$1nl9$1@gioia.aioe.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2789&group=comp.unix.programmer#2789

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!BKzeqmo2UYxb4eR2zKm0zw.user.46.165.242.75.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: Question on implementation of /dev/pts
Date: Fri, 8 Jul 2022 15:34:09 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <ta9iph$1nl9$1@gioia.aioe.org>
References: <ta6tpc$2hsfs$1@news.xmission.com> <ta6vfq$16rg$1@gioia.aioe.org> <62c709d3$0$8518$426a74cc@news.free.fr> <N3ExK.426622$X_i.362259@fx18.iad> <ta96i8$1rea$1@gioia.aioe.org> <XLWxK.34856$Eh2.5862@fx41.iad>
Injection-Info: gioia.aioe.org; logging-data="57001"; posting-host="BKzeqmo2UYxb4eR2zKm0zw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Muttley@dastardlyhq.com - Fri, 8 Jul 2022 15:34 UTC

On Fri, 08 Jul 2022 14:00:23 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
>Muttley@dastardlyhq.com writes:
>>On Thu, 07 Jul 2022 16:44:29 GMT
>>scott@slp53.sl.home (Scott Lurndal) wrote:
>
>>>In either case, since the /dev/pts entry cannot be used after the
>>>master is closed, it makes no sense to keep it around.
>>
>>If the slave process is still attached it could in theory wait for a new
>master.
>>
>
>What theory is that? Pseudo terminal behavior is standardized by
>the Open Group/POSIX specifications. /dev/ptm is a multiplexor
>which 'creates' a new client side (pts) when opened. There is no
>API to associate a new master with an existing PTS.

Why would it need an API other than what exists already? The ptm is a (virtual)
file. If it wasn't deleted something else with the correct permissions could in
theory open it. Perhaps deleting it is a security measure because of this
possibility.

Re: Question on implementation of /dev/pts

<ZfYxK.84300$%i2.42006@fx48.iad>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2790&group=comp.unix.programmer#2790

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx48.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Question on implementation of /dev/pts
Newsgroups: comp.unix.programmer
References: <ta6tpc$2hsfs$1@news.xmission.com> <ta6vfq$16rg$1@gioia.aioe.org> <62c709d3$0$8518$426a74cc@news.free.fr> <N3ExK.426622$X_i.362259@fx18.iad> <ta96i8$1rea$1@gioia.aioe.org> <XLWxK.34856$Eh2.5862@fx41.iad> <ta9iph$1nl9$1@gioia.aioe.org>
Lines: 28
Message-ID: <ZfYxK.84300$%i2.42006@fx48.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Fri, 08 Jul 2022 15:42:49 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Fri, 08 Jul 2022 15:42:49 GMT
X-Received-Bytes: 1942
 by: Scott Lurndal - Fri, 8 Jul 2022 15:42 UTC

Muttley@dastardlyhq.com writes:
>On Fri, 08 Jul 2022 14:00:23 GMT
>scott@slp53.sl.home (Scott Lurndal) wrote:
>>Muttley@dastardlyhq.com writes:
>>>On Thu, 07 Jul 2022 16:44:29 GMT
>>>scott@slp53.sl.home (Scott Lurndal) wrote:
>>
>>>>In either case, since the /dev/pts entry cannot be used after the
>>>>master is closed, it makes no sense to keep it around.
>>>
>>>If the slave process is still attached it could in theory wait for a new
>>master.
>>>
>>
>>What theory is that? Pseudo terminal behavior is standardized by
>>the Open Group/POSIX specifications. /dev/ptm is a multiplexor
>>which 'creates' a new client side (pts) when opened. There is no
>>API to associate a new master with an existing PTS.
>
>Why would it need an API other than what exists already? The ptm is a (virtual)
>file. If it wasn't deleted something else with the correct permissions could in
>theory open it. Perhaps deleting it is a security measure because of this
>possibility.
>

The master side of a pseudo terminal pair does not have a directory entry
in the file system. /dev/ptm is a special device that creates a pts pair
when opened.

Re: Question on implementation of /dev/pts

<ta9kcc$h5a$1@gioia.aioe.org>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2791&group=comp.unix.programmer#2791

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!BKzeqmo2UYxb4eR2zKm0zw.user.46.165.242.75.POSTED!not-for-mail
From: Muttley@dastardlyhq.com
Newsgroups: comp.unix.programmer
Subject: Re: Question on implementation of /dev/pts
Date: Fri, 8 Jul 2022 16:01:16 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <ta9kcc$h5a$1@gioia.aioe.org>
References: <ta6tpc$2hsfs$1@news.xmission.com> <ta6vfq$16rg$1@gioia.aioe.org> <62c709d3$0$8518$426a74cc@news.free.fr> <N3ExK.426622$X_i.362259@fx18.iad> <ta96i8$1rea$1@gioia.aioe.org> <XLWxK.34856$Eh2.5862@fx41.iad> <ta9iph$1nl9$1@gioia.aioe.org> <ZfYxK.84300$%i2.42006@fx48.iad>
Injection-Info: gioia.aioe.org; logging-data="17578"; posting-host="BKzeqmo2UYxb4eR2zKm0zw.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
 by: Muttley@dastardlyhq.com - Fri, 8 Jul 2022 16:01 UTC

On Fri, 08 Jul 2022 15:42:49 GMT
scott@slp53.sl.home (Scott Lurndal) wrote:
>Muttley@dastardlyhq.com writes:
>>On Fri, 08 Jul 2022 14:00:23 GMT
>>scott@slp53.sl.home (Scott Lurndal) wrote:
>>>Muttley@dastardlyhq.com writes:
>>>>On Thu, 07 Jul 2022 16:44:29 GMT
>>>>scott@slp53.sl.home (Scott Lurndal) wrote:
>>>
>>>>>In either case, since the /dev/pts entry cannot be used after the
>>>>>master is closed, it makes no sense to keep it around.
>>>>
>>>>If the slave process is still attached it could in theory wait for a new
>>>master.
>>>>
>>>
>>>What theory is that? Pseudo terminal behavior is standardized by
>>>the Open Group/POSIX specifications. /dev/ptm is a multiplexor
>>>which 'creates' a new client side (pts) when opened. There is no
>>>API to associate a new master with an existing PTS.
>>
>>Why would it need an API other than what exists already? The ptm is a
>(virtual)
>>file. If it wasn't deleted something else with the correct permissions could
>in
>>theory open it. Perhaps deleting it is a security measure because of this
>>possibility.
>>
>
>The master side of a pseudo terminal pair does not have a directory entry
>in the file system. /dev/ptm is a special device that creates a pts pair
>when opened.

*sigh*. I know that, never mind, you obviously didn't understand what I meant.

Re: Question on implementation of /dev/pts

<835yjacrjk.fsf@helmutwaitzmann.news.arcor.de>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2836&group=comp.unix.programmer#2836

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!aioe.org!uk09UeDaRdwcQv5zMWLmSQ.user.46.165.242.75.POSTED!not-for-mail
From: nn.throttle@xoxy.net (Helmut Waitzmann)
Newsgroups: comp.unix.programmer
Subject: Re: Question on implementation of /dev/pts
Date: Tue, 02 Aug 2022 22:35:27 +0200
Organization: Aioe.org NNTP Server
Message-ID: <835yjacrjk.fsf@helmutwaitzmann.news.arcor.de>
References: <ta6tpc$2hsfs$1@news.xmission.com> <ta6vfq$16rg$1@gioia.aioe.org>
<62c709d3$0$8518$426a74cc@news.free.fr>
<N3ExK.426622$X_i.362259@fx18.iad> <ta96i8$1rea$1@gioia.aioe.org>
Reply-To: Helmut Waitzmann Anti-Spam-Ticket.b.qc3c <oe.throttle@xoxy.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Injection-Info: gioia.aioe.org; logging-data="26969"; posting-host="uk09UeDaRdwcQv5zMWLmSQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)
X-Notice: Filtered by postfilter v. 0.9.2
Mail-Reply-To: Helmut Waitzmann Anti-Spam-Ticket.b.qc3c <oe.throttle@xoxy.net>
Mail-Copies-To: nobody
Cancel-Lock: sha1:WfROYzvg0EeXb/4X4AdBnKJ3v3I=
 by: Helmut Waitzmann - Tue, 2 Aug 2022 20:35 UTC

Muttley@dastardlyhq.com:
>On Thu, 07 Jul 2022 16:44:29 GMT
>scott@slp53.sl.home (Scott Lurndal) wrote:

>>In either case, since the /dev/pts entry cannot be used after the
>>master is closed, it makes no sense to keep it around.
>
>If the slave process is still attached it could in theory wait for
>a new master.

Do I understand correctly, that you think of the following
scenario?

Say, there is a "bash" running in an "xterm".  Run the following
shell command to get a long‐running job which determines the
pathname of its pseudo terminal, waits one day, and finally opens
the pathname of its past pseudo terminal, writing a greeting to it,
then exit:

(
tty="$(tty)" &&
sleep -- "$(( 24 * 3600 ))" &&
printf '%s\n' 'Hello, world!' > "$tty"
) &

Running the command

ps -o ppid -o sid -o tty -o tpgid -o pgid -o pid \
-o stat -o args --sort=sid,pgid,stime -s 12217

from a different session group will show the long‐running job
12314.  (The "printf" command is not shown already as it won't be
started before the "sleep" will have exited.):

PPID SID TT TPGID PGID PID STAT COMMAND
12209 12217 pts/2 12217 12217 12217 Ss+ /bin/bash
12217 12217 pts/2 12217 12314 12314 S /bin/bash
12314 12217 pts/2 12217 12314 12317 S sleep -- 86400

After exiting the shell (and the xterm), the job will keep running
orphaned:

PPID SID TT TPGID PGID PID STAT COMMAND
1 12217 ? -1 12314 12314 S /bin/bash
12314 12217 ? -1 12314 12317 S sleep -- 86400

Now, imagine, that a new xterm is opened, running a shell, and, by
incident, the pseudo terminal it gets will have the same name
"/dev/pts/2".  This should be possible, because the old "/dev/pts/2"
entry has already been removed from the directory, i. e., it
wouldn't be "reserved" any more.

As the orphaned job will explicitly open "/dev/pts/2", it would
write to the new pseudo terminal that happens to have the same name
like the old had.

Therefore, wouldn't it be more sensible to not have the name
"/dev/pts/2" removed from the (virtual) directory as long as the old
process session has not ceased to exist in the system?  That would
prevent the pseudo terminal multiplexer to create a new "/dev/pts/2"
by accident, thus prevent the "printf" command to write to the new
"/dev/pts/2".

Of course the "printf" command should have used "/dev/tty" rather
than "/dev/pts/2" in the redirection, that is, the output of the
"tty" command should be considered to be obsolete as soon as it is
received (unless one knows that the controlling terminal is still
alive).

Re: Question on implementation of /dev/pts

<ZVgGK.137135$Dh2.31756@fx42.iad>

  copy mid

http://rslight.i2p/devel/article-flat.php?id=2837&group=comp.unix.programmer#2837

  copy link   Newsgroups: comp.unix.programmer
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx42.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Question on implementation of /dev/pts
Newsgroups: comp.unix.programmer
References: <ta6tpc$2hsfs$1@news.xmission.com> <ta6vfq$16rg$1@gioia.aioe.org> <62c709d3$0$8518$426a74cc@news.free.fr> <N3ExK.426622$X_i.362259@fx18.iad> <ta96i8$1rea$1@gioia.aioe.org> <835yjacrjk.fsf@helmutwaitzmann.news.arcor.de>
Lines: 26
Message-ID: <ZVgGK.137135$Dh2.31756@fx42.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 02 Aug 2022 21:45:29 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 02 Aug 2022 21:45:29 GMT
X-Received-Bytes: 1856
 by: Scott Lurndal - Tue, 2 Aug 2022 21:45 UTC

Helmut Waitzmann <nn.throttle@xoxy.net> writes:
>Muttley@dastardlyhq.com:
>>On Thu, 07 Jul 2022 16:44:29 GMT
>>scott@slp53.sl.home (Scott Lurndal) wrote:
>
>>>In either case, since the /dev/pts entry cannot be used after the=20
>>>master is closed, it makes no sense to keep it around.
>>
>>If the slave process is still attached it could in theory wait for=20
>>a new master.
>
>Do I understand correctly, that you think of the following=20
>scenario?
>
>Say, there is a "bash" running in an "xterm".=C2=A0 Run the following=20
>shell command to get a long=E2=80=90running job which determines the=20
>pathname of its pseudo terminal, waits one day, and finally opens=20
>the pathname of its past pseudo terminal, writing a greeting to it,=20
>then exit:

So long as any process has the original /dev/pts/2 client side open, the mux
will _never_ assign /dev/pts/2 to a new process. Even if the directory entry
no longer exists, the internal operating system data structure (inode)
will exist so long as any process still has it open and the mux will
ignore it.


devel / comp.unix.programmer / Re: Question on implementation of /dev/pts

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor