Home Directory Helper

Anyone whose ever imple­mented net­worked home direc­to­ries on and OS X Server has prob­a­bly come across the need to add or remove pref­er­ence files from user accounts. Chang­ing set­tings for new accounts is easy, just add the files to the User Template folder.

Exist­ing users is a dif­fer­ent story though. They already have their home direc­to­ries. Depend­ing on how many users you have, adding/deleting files from you old users can be a daunt­ing task. Ten users is easy enough, but 50 is silly and over 100 is ridiculous.

Long ago I wrote a series of scripts (well actu­ally just one) that I use and modify for what­ever files I need to change. I basi­cally just loops through each home folder in a spec­i­fied direc­tory. It’s really a pretty basic script. Here’s an exam­ple of one that I was using:

# Copy new dock and fix permissions

echo "\ncpdock.sh"

dir=`ls $1`

cd ${1:?"No directory specified!"}

echo "PWD = `pwd`"

echo "\n$dir\n"

for folder in $dir; do
    echo "...copying dock plist to $folder"
    cp /com.apple.dock.plist $folder/Library/Preferences/com.apple.dock.plist
    chmod -R 700 $folder/Library/Preferences/com.apple.dock.plist
    chown -R $folder:staff $folder/Library/Preferences/com.apple.dock.plist
done

That’s easy enough. It’s kind of a pain though to modify the scripts all the time. Also, it’s very dif­fi­cult (and scary) to try and explain how to use these scripts to my less Bash-​inclined co-​workers.

The other day I found this great little piece of soft­ware writ­ten by Nicole Jacque called Home Direc­tory Helper. It does exactly what all of my scripts did, except with an easier to use GUI inter­face. Very nice, and highly recommended.

Madden ‘09: Madden-sized Disappointment

I finally got my hands on my copy of Madden ‘09 ear­lier this week. I had actu­ally gotten the game pre-​ordered way back in early-​July, but didn’t end up get­ting it until this week.

Let me get this part out of the way first: Dear EA Sports. For the love of god, please hire some frack­ing user inter­face design­ers. The user inter­face for Madden sucks, and seems to get worse every year. Quit spend­ing all of your time making every­thing glossy and shiny. Just make it better. If you’re unsure of how to do this, WWDC might be a good place to start.

Moving on. My first impres­sions of the game went some­thing like this:

  • Load­ing, Wait­ing, Load­ing, Waiting
  • Madden Test. Neat idea. What’s with the weird glassy field and see-​through players?
  • Appar­ently I am close to all-​madden on offense, but am still at rookie level on defense. Inter­est­ing. The com­bined IQ puts me at below 500.
  • Load­ing, Wait­ing, Load­ing, Waiting
  • Start up fran­chise mode. No need to save, I just started.
  • Start first game. Oh wait, I can prac­tice for points. Umm, really con­fus­ing, I have no idea what I’m doing. OK, I com­pletely bug­gered up what­ever that was. Let’s start the god­damned game already.
  • Load­ing, Wait­ing, Load­ing, Waiting
  • Because of my offense in the madden test, play­ing offense now is com­pletely impos­si­ble for me. I quickly throw one inter­cep­tion and punt twice. Despite my rookie-​level defen­sive set­tings, the Jaguars quickly pass and rush their way down the field and score on me. This is not going very well.
  • What’s with all of the ridicu­lous camera angles?
  • Is it just me or is the game-​pace faster?
  • Some­time in the late first quar­ter or early second, I call a play from the play call screen. The sound con­tin­ues, but the screen freezes at the play call. I hear my play­ers run the play I called, the con­troller vibrates, announc­ers con­tinue talk­ing. I can actu­ally con­tinue pick­ing plays an even call time­outs, but the screen is com­pletely frozen. I have to restart the game.
  • At this point, I real­ize that I had not saved any­thing yet and decide that maybe I would rather do some­thing else.

That was Wednes­day night. Thurs­day night went like this:

  • Repeat all steps from Wednes­day night

So basi­cally, I’ve attempted to play exactly two fran­chise games. I have not even made it to half­time with­out the game freez­ing on me. WTF EA Sports. This is the sor­ri­est excuse of a release game. It is unplayable. Even worse, a quick Google search shows that I’m not the only one:

Madden Freeze Search

Keep in mind here that this game is brand new and I played it exactly twice; both times it froze. My PS3 is only a couple of months old as well. The offi­cial EA Forum has a thread about the freez­ing issues. It’s cur­rently 37 pages long.

I was really hoping that this game would look great on the PS3. I didn’t expect for it not to work at all. I really hope that that class action law­suit suc­ceeds and they sue the shit out of EA.

Discover which programs prevent disk image ejection

I stum­bled across this great tip the other day about solv­ing that pesky error mes­sage that hap­pens when you try and eject a that is busy disk. This seems to happen all too often, I’ll try and eject one of my exter­nal hard drives and get the mes­sage even though there are no vis­i­ble pro­grams using it. Sigh. Use this com­m­mand in Terminal:

lsof | grep DISKNAME

Read the full tip from Mac OS X Hints.

Leopard Server Quickstart Guide

Corey Carson was writ­ten a fan­tas­tic quick­start guide for Leop­ard Server.

This updated quick­start guide is very sim­i­lar to the Tiger Server Quick­start Guide posted in 2005. It’s pri­mary pur­pose is to get you up and run­ning quickly, over­com­ing common hur­dles such as DNS and bind­ing con­fu­sions. With the move to launchd over cron, those steps are now included as well.

You can grab the pdf at AFP548.com.

The arti­cle includes some par­tic­u­larly good instruc­tions on using and set­ting up rsync, launchd, and Net­work Home Redirector.

Via Infinity’s End.

You Are Unable to Log in to the User Account at Time

This one is just a quickie, but I thought I’d post it because I know that I’ve gotten this mes­sage before and that there is very little useful infor­ma­tion turned up in a rel­e­vant Google search.

At my work we use an OS X server to host the home direc­to­ries of all of our users who log in to our lab com­put­ers. We cur­rently only sup­port OS X clients, so we’re only doing this over AFP. Last semes­ter we used a Tiger server and clients, but this summer we are upgrad­ing every­thing to Leopard.

After set­ting up a test client com­puter in Direc­tory Util­ity (used to be Direc­tory Access in Tiger) to con­nect to our server I fig­ured we were good to log in with one of migrated user accounts. We don’t do bind­ing or Active Direc­tory or really any­thing com­pli­cated so usu­ally the process is pretty straightforward.

After set­ting up the client and restart­ing, I attempted to log on using one of our net­work users, and was met with this big fat error message:

You are unable to log in to the user account [username] at this  time

Not only did not log­ging in not work, but the entire descrip­tion of the error read “Logging in to the account failed because an error occurred”. Gee, thanks Apple. Very useful.

This error wasn’t entirely for­eign to me. I remem­bered seeing it occa­sion­ally in Tiger, but couldn’t remem­ber if we had ever estab­lished a cause, let alone a solu­tion. Just for kicks I tried log­ging on with the same account on one of our older Tiger clients (that was known to work with the old Tiger server). The mes­sage is slightly more ver­bose, but gen­er­ally still the same:

You are unable to log in to the user account [username] at this  time (Tiger Message)

I knew that AFP was work­ing because we had some share points up and run­ning. So, AFP and at least some level of authen­ti­ca­tion were work­ing. After inspect­ing the server fire­wall and open direc­tory logs, as well as the client logs, it seemed clear that the user was authen­ti­cat­ing prop­erly. It was some­thing that was hap­pen­ing after the actual suc­cess­ful authen­ti­ca­tion that was caus­ing the error message.

After some research and thought, it occurred to me that it was very likely that there was some sort of con­fig­u­ra­tion gone awry with the actual home direc­to­ries. Then I real­ized that I had com­pletely neglected to actu­ally con­fig­ure the old home direc­to­ries on our server to be shared at all!

So basi­cally the user was log­ging in and authen­ti­cat­ing suc­cess­fully. Then when the client asked for the home direc­tory the server was like, what home direc­tory? And the client was like aww shit. I’m gonna log you out right now ’cause I need your home to work. And the server was like, all right, fine. Some­thing like that.

After some simple home direc­tory shar­ing con­fig­u­ra­tions, every­thing was run­ning with­out another episode. Sigh.