zsh-users
 help / color / mirror / code / Atom feed
* Re: .zlogout RE: Problem w/ ulimit killing compiles on sol 2.4&2.6 ...
@ 1999-02-04 18:38 Phil Pennock
  0 siblings, 0 replies; 6+ messages in thread
From: Phil Pennock @ 1999-02-04 18:38 UTC (permalink / raw)
  To: Zsh users list

Typing away merrily, Peter Stephenson produced the immortal words:
> > For those who really want maintenance logs or whatever, but still want
> > to exec something (an interruptible secure program), I usually suggest a
> > function/alias that does a TRAPEXIT/trap '' 0  -- is this really the
> > best idea?
> 
> The exit trap isn't run before an exec, for just the same reason that
> .zlogout isn't, i.e. the shell isn't exiting, it's overlaying a
> process without forking first.  I should think the only thing you can
> do is hook into exec itself by an alias or function.  But the securer
> you want to be, the better it probably is just to call whatever
> explicitly before the exec.  Unless you're saying something slightly
> different to what I've understood.

I think I am.  I meant:
function exit_and_foo {
	function TRAPEXIT { exec foo }
	exit
}
defined and then just call exit_and_foo.
-- 
--> Phil Pennock ; GAT d- s+:+ a23 C++(++++) UL++++/I+++/S+++/B++/H+$ P++@$
L+++ E-@ W(+) N>++ o !K w--- O>+ M V !PS PE Y+ PGP+ t-- 5++ X+ R !tv b++>+++
DI+ D+ G+ e+ h* r y?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: .zlogout RE: Problem w/ ulimit killing compiles on sol 2.4&2.6 ...
@ 1999-02-04 15:34 Bart Schaefer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 1999-02-04 15:34 UTC (permalink / raw)
  To: Zsh users list

On Feb 4,  2:47pm, Peter Stephenson wrote:
} Subject: Re: .zlogout RE: Problem w/ ulimit killing compiles on sol 2.4&2.
}
} "Andrej Borsenkow" wrote:
} > BTW if zsh is started as csh, are csh-specific files (.login, .cshrc,
} > .logout) executed?
} 
} No, because the syntax is do different to have any hope of this
} working.

That's what Misc/c2z is for.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: .zlogout RE: Problem w/ ulimit killing compiles on sol 2.4&2.6 ...
@ 1999-02-04 15:21 Peter Stephenson
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 1999-02-04 15:21 UTC (permalink / raw)
  To: Zsh users list

> Does a reminder about the effect of exec belong in the manual or the
> FAQ?

Well, there's no harm in being explicit (this patch is a
replacement).

> For those who really want maintenance logs or whatever, but still want
> to exec something (an interruptible secure program), I usually suggest a
> function/alias that does a TRAPEXIT/trap '' 0  -- is this really the
> best idea?

The exit trap isn't run before an exec, for just the same reason that
.zlogout isn't, i.e. the shell isn't exiting, it's overlaying a
process without forking first.  I should think the only thing you can
do is hook into exec itself by an alias or function.  But the securer
you want to be, the better it probably is just to call whatever
explicitly before the exec.  Unless you're saying something slightly
different to what I've understood.

--- Doc/Zsh/files.yo.logout	Wed Jun  3 00:00:27 1998
+++ Doc/Zsh/files.yo	Thu Feb  4 16:11:49 1999
@@ -20,6 +20,12 @@
 Finally, if the shell is a login shell, tt(/etc/zlogin) and
 tt($ZDOTDIR/.zlogin) are read.
 
+When a login shell exits, the files tt($ZDOTDIR/.zlogout) and then
+tt(/etc/zlogout) are read.  This happens with either an explicit exit
+via the tt(exit) or tt(logout) commands, or an implict exit by reading
+end-of-file from the terminal.  However, if the shell terminates due
+to tt(exec)'ing another process, the logout files are not read.
+
 If tt(ZDOTDIR) is unset, tt(HOME) is used instead.
 Those files listed above as being in tt(/etc) may be in another
 directory, depending on the installation.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: .zlogout RE: Problem w/ ulimit killing compiles on sol 2.4&2.6 ...
@ 1999-02-04 14:30 Phil Pennock
  0 siblings, 0 replies; 6+ messages in thread
From: Phil Pennock @ 1999-02-04 14:30 UTC (permalink / raw)
  To: Zsh users list

Typing away merrily, Peter Stephenson produced the immortal words:
> This is a strange omission.  It's executed any time a login shell
> exits (unless it crashes, obviously).  I hope the patch makes it clear
> enough.
[...]
> +When a login shell exits, the files tt($ZDOTDIR/.zlogout) and then
> +tt(/etc/zlogout) are read.
> +

Does a reminder about the effect of exec belong in the manual or the
FAQ?  I've had to sort out problems for a few people (normally
.bash_logout rather than .zlogout) where they just hadn't thought
through that using exec foobar would stop the shell sourcing the logout
scripts.

For those who really want maintenance logs or whatever, but still want
to exec something (an interruptible secure program), I usually suggest a
function/alias that does a TRAPEXIT/trap '' 0  -- is this really the
best idea?
-- 
--> Phil Pennock ; GAT d- s+:+ a23 C++(++++) UL++++/I+++/S+++/B++/H+$ P++@$
L+++ E-@ W(+) N>++ o !K w--- O>+ M V !PS PE Y+ PGP+ t-- 5++ X+ R !tv b++>+++
DI+ D+ G+ e+ h* r y?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* .zlogout RE: Problem w/ ulimit killing compiles on sol 2.4&2.6 ...
@ 1999-02-04 13:52 Andrej Borsenkow
  0 siblings, 0 replies; 6+ messages in thread
From: Andrej Borsenkow @ 1999-02-04 13:52 UTC (permalink / raw)
  To: Peter Stephenson, Greg Sylvain, Zsh users list


Just to mention, that .zlogout is listed in FILES section in manual, but
never mentioned anywhere in text. In particular, I don't know, if .zlogout
is _always_ excuted when shell exits (e.g. HUP) or only when exiting with
exit/logout command. Or only logout?

BTW if zsh is started as csh, are csh-specific files (.login, .cshrc,
.logout) executed?

/andrej



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: .zlogout RE: Problem w/ ulimit killing compiles on sol 2.4&2.6 ...
@ 1999-02-04 13:47 Peter Stephenson
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 1999-02-04 13:47 UTC (permalink / raw)
  To: Zsh users list

"Andrej Borsenkow" wrote:
> Just to mention, that .zlogout is listed in FILES section in manual, but
> never mentioned anywhere in text. In particular, I don't know, if .zlogout
> is _always_ excuted when shell exits (e.g. HUP) or only when exiting with
> exit/logout command. Or only logout?

This is a strange omission.  It's executed any time a login shell
exits (unless it crashes, obviously).  I hope the patch makes it clear
enough.

> BTW if zsh is started as csh, are csh-specific files (.login, .cshrc,
> .logout) executed?

No, because the syntax is do different to have any hope of this
working.

--- Doc/Zsh/files.yo.logout	Wed Jun  3 00:00:27 1998
+++ Doc/Zsh/files.yo	Thu Feb  4 14:43:29 1999
@@ -20,6 +20,9 @@
 Finally, if the shell is a login shell, tt(/etc/zlogin) and
 tt($ZDOTDIR/.zlogin) are read.
 
+When a login shell exits, the files tt($ZDOTDIR/.zlogout) and then
+tt(/etc/zlogout) are read.
+
 If tt(ZDOTDIR) is unset, tt(HOME) is used instead.
 Those files listed above as being in tt(/etc) may be in another
 directory, depending on the installation.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-02-04 18:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-04 18:38 .zlogout RE: Problem w/ ulimit killing compiles on sol 2.4&2.6 Phil Pennock
  -- strict thread matches above, loose matches on Subject: below --
1999-02-04 15:34 Bart Schaefer
1999-02-04 15:21 Peter Stephenson
1999-02-04 14:30 Phil Pennock
1999-02-04 13:52 Andrej Borsenkow
1999-02-04 13:47 Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).