[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SEUL: Stopping dreams



On Tue, 17 Feb 1998, Orn E. Hansen wrote:

> 
> řann 17-Feb-98 skrifar George Bonser:
> > 
> > You have to be careful here, EVERY shell that exits will execute
> > .bash_logout.
> > You have to write the pid of the shell that started the session to a file and
> > test the contents of that file (or the existance of the file of you make the
> > name a function of the PID) on exit so only the shell that started the the
> > session will kill it on exit. I know it is common sense but it is worth
> > mentioning.
> > 
>   That scheme isn't necessary, there should be an environment variable called
> SHLVL (it's there in csh and tcsh), which tells the shell level you're in.  You
> can check this level, to see if you're in at a startup or not.  The tricky
> thing to remember is, that if you're running inside X, the .xsession script is
> running at shell level 1, and all xterms at shell level 2.
> 


Not true.  If I am at the console and start X then log into the box via
telnet and exit the telnet connection, it will be at level 1 and would 
kill the x session when the telnet session ended.  You need to make sure
that it is the same shell process exiting that started the X session.