[comp.unix.internals] Session management

pcg@cs.aber.ac.uk (Piercarlo Grandi) (09/04/90)

On 27 Aug 90 02:33:22 GMT, tchrist@convex.COM (Tom Christiansen) said:

tchrist> In article <8319:Aug2617:20:3690@kramden.acf.nyu.edu>
tchrist> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:

brnstnd> The difficulties with locking up tty ports are reflections of
brnstnd> two different problems: first, that ptys aren't dynamically
brnstnd> allocated in 4BSD; and second, that standard ttys exist at all.
brnstnd> Hardwired /dev/tty* should be replaced with raw /dev/modem* and
brnstnd> so on; *all* tty use should go through a common interface
brnstnd> provided by a pseudo-terminal session manager. This would solve
brnstnd> many problems at once.

Uhm. The basic problem is actually that you cannot put a line discipline
on a pipe so as to make it look like a tty line, otherwise pipes and
named pipes would be amply sufficient. Actually (named) pipes that you
can push line disciplines on and that can transfer file descriptors (the
other great idea to avoid abusing the filesystem namespace too much)
already exist, and are called streams.

Another way to get around the pipe/socket/tty incompatibility problem is
to have protocol converters among the various details of these
interfaces, and such things are part of the (unimplemented) design of
4.2BSD, under the name of wrappers.

tchrist> I think there is a crying need such a thing because the same
tchrist> code gets written again and again to do essentially the same
tchrist> thing.

I think there is acrying need for something like Accent or MUSS, where
all system objects are represented by an anonymous, opaque IPC port, and
IPC ports can be freely interchanged one with another. Too bad we don't
have that uniform interface under UNIX.

tchrist> I would make a daemon server that everyone talked to in order
tchrist> to get the session.  You could instead put it in the kernel as
tchrist> a special "/dev/pty" pseudo-driver that did the allocation for
tchrist> you, but I don't see much that having it in the kernel might
tchrist> gain you considering the cost.

The fashionable thing nowadays would be to implement it as a file system
type, or maybe even an NFS filesystem server, both under BSD or System V
type systems. I am not too fond of this abuse of the filesystem notion,
but such is the trend...
--
Piercarlo "Peter" Grandi           | ARPA: pcg%uk.ac.aber.cs@nsfnet-relay.ac.uk
Dept of CS, UCW Aberystwyth        | UUCP: ...!mcsun!ukc!aber-cs!pcg
Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk

smb@ulysses.att.com (Steven Bellovin) (09/06/90)

Since a lot of this discussion is based on my session management paper,
I've put the text on inet.att.com, in /dist/sessext.ps.  Feel free to
snarf it via anonymous ftp.  The paper was presented at Usenix in June '88.


		--Steve Bellovin
		smb@ulysses.att.com

> Once again, pty 3.001, the ultimate pseudo-terminal manager (implemented
> for BSD variants only at the moment), will appear soon on c.s.unix. If
> you're desperate, ask rsalz@bbn.com. If you're really desperate, anon
> ftp to the pub/ directory on 128.122.128.22.

Dan -- for the paranoid among us, given that you've got binary (i.e.,
compressed) files out there, could you create a tar image as well
as shar?  They're a lot easier to scan for unpacking surprises...