LogoutHook Freezes Logout After Safe Boot

Greetings, folks!

I have a shell script (appended below) running as a log-out event (I use it as a test for more productive uses. :wink: ). It works great! But when I boot into Safe Mode, I cannot log out or restart without the computer freezing; a forced shutdown is necessary.

I expect that booting into Safe Mode disables some function that is then unable to run when the log-out script is called and the screen has been reduced to just the desktop with no menubar, icons, or mouse. There is no “spinning wheel.”

Is there some way to set the script such that it doesn’t freeze the system when logging out after a Safe Boot?


Richard Fairbanks

#!/bin/sh osascript -e ˜set volume output volume 60' osascript -e ˜say "good [[emph -]] night my [[emph -]] love" using "Vicki"' sleep 1 /usr/bin/afplay -v 0.2 ˜/Users/me/Library/Sounds/Fairy Wink.aac' osascript -e ˜set volume with output muted' sleep 2 # this seems to be necessary to make sure the volume gets muted

Model: 2.33GHz MBPC2D
Browser: Google Chrome 7 10.0.634.0 dev
Operating System: Mac OS X (10.6)


I don’t have a solution, but I’d like to know, what is the benefit to boot into save mode (while the computer runs without any problems)?

In my entire Macintosh life (almost 20 years) I used it three times.
In all cases there was a problem with an incompatible extension after an system version update

Hi Stefan; thanks for your feedback!

Sorry for the delay . . .

I use Safe Boots for a similar purpose as well, but I am just much more cautious than most. Details below . . .

Regarding the issue of how to implement an AppleScript-like “try” block for a shell script, so that any errors can get ignored, I found this link, in which Craig Williams recommends a great source for /dev/null info. I am not eager to do Safe Boots unless necessary (as noted below), but when I again need to, I will report the result(s) here.

The LogoutHook shell script now reads:


the following line is for testing error-handling :wink:

wibble > /dev/null 2>&1
osascript -e ‘set volume output volume 60’ > /dev/null 2>&1
osascript -e ‘say “good [[emph -]] night my [[emph -]] love” using “Vicki”’ > /dev/null 2>&1
sleep 1 > /dev/null 2>&1
/usr/bin/afplay -v 0.2 ‘/Users/me/Library/Sounds/Fairy Wink.aac’ > /dev/null 2>&1
osascript -e ‘set volume with output muted’ > /dev/null 2>&1

this seems to be necessary to make sure the volume gets muted

sleep 2 > /dev/null 2>&1[/code]
Thanks, Craig!

Safe Boots and System Version Updates:

One of the procedures I follow is Samuel Herschbein’s advice for a system version update (scroll down a screen or so for the details); I also use AppleJack as well (which I prefer to use over Safe Boot when possible).

When I install a new system version, I often do a full backup, erase and zero-out the drive, and then restore apps and docs on an as-needed basis. A faster, more stable computer is a common result. 10.6.5 and 10.6.6 have been significantly faster due to this process.

I had been using Safe Boots often recently to troubleshoot a software glitch that I finally resolved. I actually don’t like to use Safe Boots because of all the Launch Services, quarantines, etc. that then have to be recreated.


Richard Fairbanks

Good grief! Some people maintain their system to death :wink:

I’ve never used Onyx or similar tools, it could more damage than profit.
I’ve never used AppleJack, I can’t stand to be dependent on tools which hook in quite deeply into the system.
I’ve never used any Combo Update.
I’ve never installed haxies, gimmicks, UI beautifiers, or obscure input managers like SIMBL

My update policy is:
¢ Of course backups at regular intervals
¢ Clean install on each system version upgrade (x.x.0 version)
¢ Always normal delta updater (x.x.1 and higher)
¢ repair privileges after each update

That’s all.
I’ve never had problems, except the three times I booted into safe mode.