Subject: Re: pcvt and TIOCCONS
To: None <>
From: Gordon W. Ross <>
List: current-users
Date: 04/19/1996 12:53:09
> Date: Fri, 19 Apr 1996 08:28:36 -0400
> From: "Perry E. Metzger" <>

> Ty Sarna writes:
> > I have a few issues with it:
> > 
> > % Actions to be performed at login and logout time would be controlled
> > % by two files: /etc/tty_login and /etc/tty_logout respectively.  Both
> > 
> > I'd really rather have it all in one file. See below.
> Agreed. One file would be better.

Please, please, let's keep this to objective arguments.
Nobody is served by "I like this way better, period."
WHY is it better?  What is easier or harder either way?

> > % The tty_name would be matched against the name of the current
> > % tty line so all lines (and only those lines) with he tty_name
> > % field matching would be processed.
> > 
> > I like cgd's idea about supporting globs here.
> Also agreed.

This lets you have one record apply to many tty lines.
Is this something people actually want to do or just a
"creaping feature?"

> > % The shell_command field would be run as 'sh -c "shell_command"'
> > % with the following environment variable guaranteed to be set:
> > % 
> > % 	USER=user_name
> > 
> > Also need GROUP for the user's group name.
> > Might be nice to have TTY as the login tty's name.
> Necessary, actually, plus the script should be called with a parameter
> to tell you if you are logging in or out, so that in theory you could
> have one program do the whole thing.

You have complete control over the arguments passed to the command.
With the two file approach you can do this:

	# tty_login
	console		/etc/console_frob login

	# tty_logoug
	console		/etc/console_frob logout

If we used the "one file" approach with an "action" field, this
could be done as follows:

	# ttyactions
	console		login	/etc/console_frob login
	console		logoug	/etc/console_frob logout

Or, as Ty suggested, we could allow globbing of the action
field too and supply $ACTION in the environment.

I'm not convinced that globbing of either tty names or actions
actually makes life significantly easeier for anybody, and it
means doing one (or even two) regcomp();regexec();regrfree()
calls for each line of the tty_login:tty_logout:ttyactions
file (which ever of those we use).

We do not provide globbing in /etc/ttys so why should we do
it in the file(s) that specify tty login/logout actions?