Re: Script to reboot from X into 9 (avoiding data loss)
Re: Script to reboot from X into 9 (avoiding data loss)
- Subject: Re: Script to reboot from X into 9 (avoiding data loss)
- From: John W Baxter <email@hidden>
- Date: Sun, 10 Mar 2002 10:52:18 -0800
At 17:53 +0000 3/10/2002, Mr Tea wrote:
>
As a postscript to this thread, I feel I should spell out the danger of
>
using the 'do shell script' shutdown command to initiate a restart - at
>
least without taking additional precautions. A quick test revealed that
>
this method of restarting, posted by Phi Sanders earlier in this thread,
>
is somewhat brutal. It pulls the plug on apps that have open, unsaved
>
documents *without* offering the opportunity to save, and any running
>
applications are seemingly not given the chance to write updated
>
preference files (re the position & open/closed state of palettes, etc).
>
Scary.
>
>
Much safer to use the Finder's restart command, which offers all the
>
usual courtesies but, as John C Welch has pointed out, needs to be
>
wrapped in an 'ignoring application responses' block to enable it.
Indeed. The
shutdown -r now
command is rather brutal in a multiple user situation in Unix, as well.
It broadcasts a message to all terminals and pseudo-terminals and then
immediately tells all processes (with a few exceptions) to terminate. Then
it tells the few exceptions to terminate, and causes the machine to restart.
In Unix, the "now" is typically used in emergencies. Replacing the "now"
with other time specifications provide more ability for interactive users
to go away. It's not uncommon to execute the shutdown command several days
in advance: "Saturday, March 16, we will shut the
system down for about four hours to replace the broken framble-snatcher.
The BSDi and Linux shutdown commands have some more options than ours does,
including the incredibly-useful -c (cancel) which stops a previously done
shutdown whose time hasn't arrived yet (UPS lost the new framble-snatcher,
so we won't shut down after all).
From the man page:
time Time is the time at which shutdown will bring the system down and
may be the word now (indicating an immediate shutdown) or specify a
future time in one of two formats: +number, or yymmddhhmm, where
the year, month, and day may be defaulted to the current system
values. The first form brings the system down in number minutes
and the second at the absolute time specified.
The man page goes on about the sequence of events a terminal user sees as
the time for shutdown approaches.
--John (who has used the -c option to shutdown exactly once, when he gave
a shutdown -r +10 command in a window on the wrong machine and realized his
error in time...the machine in question had been up about 300 days, and
continued until the late 500 day range when we did restart it...an
accidental restart would have been a shame)
--
John Baxter email@hidden Port Ludlow, WA, USA
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.