Wow -- I read Wired magazine for a while, but then their content seemed to get stale and uninteresting.
Here's a tip from their website that seems to have solved my problem. I have a Mac running Mavericks (yes, I am way behind the times). When I have tried to shut it down recently, it took forever.
SLOW AND STALLED RESTARTS AND SHUTDOWNS
Shutting down the computer seems like the easiest feature to get right. But for some (including me), it's become a patience game as the computer gets stuck on the grey screen prior to a full shutdown. To get your Mac back on track without resorting to holding down the power button until it shuts off you'll need to hop into the Terminal and make a few changes. Copy and paste the commands below one at a time. After the first command, you'll be prompted to enter your password.
sudo defaults write /System/Library/LaunchDaemons/com.apple.coreservices.appleevents ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchDaemons/com.apple.securityd ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchDaemons/com.apple.mDNSResponder ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchDaemons/com.apple.diskarbitrationd ExitTimeOut -int 1
sudo defaults write /System/Library/LaunchAgents/com.apple.coreservices.appleid.authentication ExitTimeOut -int 1
After you've run all these commands in the Terminal, open up Disk Utility from /Applications/Utilities folder.
Select the drive you've installed Mavericks on and select Repair Permissions. After Disk Utility is finished, you should be able to select shutdown and restart with no more lagging or stalling problems.