shutdown/restart hooks?

Axel Luttgens luttgens at fusl.ac.be
Thu Nov 29 01:20:20 PST 2007


On 28/11/07 18:21, r.wessen at neu.edu wrote:

>Anyone ever found hooks for shutdown or restart?
>
>I know they exist in loginwindow for login/logout.  I can find limited 
>reference to shutdown and restart also being controlled by loginwindow, 
>but no reference to whether you can hook in a script there.
>  
>
Try with:

    /etc/rc.local

for startup and with:

    /etc/rc.shutdown.local

for shutdown.

They seem to be still supported with Leopard.

Of course, some experimentation may be needed, as they are executed 
rather early in the system's initialization or rather late in the 
system's shutdown: one can't blindingly expect every service to be 
available, nor to have much time at disposal (especially for the 
shutdown hook's execution).


HTH,
Axel


More information about the MacOSX-admin mailing list