10.5.2 Odissey: a small journey in Mac OS X services and components

Well, I'm really happy with OSX 10.5.2. Even I'm not the one that blamed Apple for the translucent menu bar that everyone dislikes.. well, I like it. I don't care about the TM menu bar tool, because I haven't bought (yet) the nifty Time Capsule, I like the spinner in the Airport menu and, most of all, I really like the updates to the BluetoothSCOAudioDriver.kext that drives my bluetooth headset.

Spotlight also feels faster and faster on every upgrade, and I'm a heavy spotlight user, so this makes me really happy. Thanks Apple engineers!

Back to the topic: why odissey? Because as per my battery hints, I managed to make my MacBook2,1 SHUT DOWN while at 74% of the "Writing files" phase of the combo update... resulting in a completely broken system, as every geek could imagine Smiling. Apple updated some libraries, and upon reboot simply nothing worked, and the darwin console was filled with lots of error messages.

The standard apple fanb^Wuser would have simply archived and installed his system, but hey, I'm a proud geek, and I know that disaster recovery situations are the best ones to learn something about an operating environment, because you have to bring services up and find some way to re-apply the combo update without having the nifty Aqua interface. Luckily enough, on OSX every GUI has its CLI counterpart, following the best "UNIX guidelines" of interest separation and well designed architecture. Furthermore, OSX takes this approach one step further, following the best software engineering principles, where functionalities are implemented in Frameworks and both the GUI and CLI interfaces use it. Well done!

The odissey started with a CMD-s to boot in single user mode, /sbin/fsck -fy, /sbin/mount -uw / in order to have a writable root. I started directly with a hdiutil attach -noverify -verbose -mount required /Users/vjt/Downloads/MacOSXUpdCombo10.5.2.dmg in order to mount the update disk image, but it failed because the diskarbitrationd wasn't running. So i fired up launchctl and issued load /System/Librar/LaunchDaemons/com.apple.diskarbitrationd.plist, when I discovered that it needed both the configd daemon and the notifyd daemon, so I loaded them up in launchd and.. YAY! the disk image was correctly mounted in /Volumes/Mac OS X Update Combined!

Here things started to complicate a bit, because an easy task like installer -package MacOSXUpdCombo10.5.2.pkg -target / failed with NSInvalidArgumentException in [IFRunnerProxy requestKeyForRights:askUser:] unrecognized selector sent to instance 0x79ac50. Well, here the Objective-C method was pretty self-explaining, the installer was trying to ask the user permission to install the package. That's quite strange, because i was running the installer command as root, so no request should have been issued. I started scratching my head, and thought about the DirectoryServices, maybe because they were unavailable "something wrong"(tm) was happening?

OK, let's try loading the com.apple.DirectoryServices property list inside launchd.. it didn't work and dyld spit out this enlightening error message:

com.apple.DirectoryServices[11980]: dyld: lazy symbol binding 
  failed: Symbol not found: _res_interrupt_requests_enable 
voyager com.apple.DirectoryServices[11980]:   Referenced from:
  /usr/sbin/DirectoryService
com.apple.DirectoryServices[11980]:   Expected in:
  /usr/lib/libresolv.9.dylib

ARGH! Something was changed in the libresolv! I had 10.5.1's DirectoryServices and 10.5.2's libresolv! Gotta restore the old version to make DS run. I first tried with a netcat from another 10.5.1 box, but with my surprise the three-way handshake wasn't completed between the two endpoints so no data could be transferred.

Luckily, because i already brought up the diskarbitration daemon, I could easily put the library on an USB storage device, plug it in and have it mounted in /Volumes. It did work and Directory Services were up&running.. but still the same ugly NSInvalidArgumentException error when launching the installer utility. Sigh.

At this point, I gave up because my journey has been interesting enough and I had a really more confortable way to fix up my problem: an USB-attached hard disk with a vanilla Leopard installation from which i could boot up my MacBook, easily double click the disk image update from the Finder and lazily launch an installer -target /Volumes/disk0 -package /Volumes/disk0/Users/vjt/Downloads/MacOSXUpdCombo10.5.2.dmg to re-run all the upgrade procedures that would fix my Leopard installation. So i followed this path, because I had some work to do and could not perseverate in my geeky journey with the Darwin console, even if it had been really entertaining.

After installer completed its job, I rebooted and a shiny new 10.5.2 greeted me with the usual Mac OS X login window that on my box sports the "All your base are belong to us" slogan Eye-wink.

Hope you enjoyed this journey as I did, and if you're a Linux fanb^Wuser don't underestimate the cleaniness and cleverness of Mac OS X that every Apple geek tries to share with you.

Comments

Il genio che è in te...

e quando uno si appresta a fare un massive update usando solo la batteria deve essere per forza un genio del male ...tipo Skeleton di Hi-Man

Bè il lato positivo è che se dovesse succede a noi sappiamo già dove andare a leggere e ti sei già sbattuto tu per noi....gratis...
Molto gentile...MAWHAHAAHAWHAWHAHW

(cmq per un hd firewire 800 ci vuole il cavo 9-9, x il 400 6-6 ..asd)

beh, son curioso, lo sai. i

beh, son curioso, lo sai.

i disaster recovery sono un'ottima occasione per imparare qualcosa riguardo gli internals di un OS, con Linux mi e` successo parecchie volte.

--
il vero sballo e` dire SUX

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <span>
  • Textual smileys will be replaced with graphical ones.
  • Inline assets are allowed.
  • You can use BBCode tags in the text, URLs will automatically be converted to links.

More information about formatting options

============================================================================================================================================