Ending a session when user exits a program.

Jeremy C. Reed plug-discuss@lists.plug.phoenix.az.us
Wed, 26 Feb 2003 10:06:16 -0800 (PST)


> Jeremy's idea to put the command in a shell script and call that is
> probably the most foolproof solution, but I was thinking that it might
> work if you used "\ " instead of just spaces.  It would certainly be
> easier to sed through when changes are needed.  And it would allow you
> to change options more easily on a user by user basis, instead of
> writing a script for each different set of options.

That would really depend on the tool used for logging in. For example,
openssh uses:

                /* Execute the shell. */
                argv[0] = argv0;
                argv[1] = NULL;
                execve(shell, argv, env);

The "shell" is the full path to the login shell. If it had options, the
file would not exist.

To make it easy, the script could be the same for all users, but modify
what it does based on the environemtn variables (such as USER, LOGNAME,
HOME).

   Jeremy C. Reed
   http://bsd.reedmedia.net/