Saved Application States in Lion

Every new feature comes with its own troubleshooting as most will, if only eventually, have problems. Lion comes with a cool new feature where the state of each application is saved and when the application is re-opened the windows are just as you left them when closed, even in the same positions on the screen. This can be pretty useful with something like Terminal, where I often don’t restart the app for long periods of time because I want to see my recent history across multiple sudo’d users. When you open Terminal, the previous commands are grey, but there. But I’ve run into a few instances where an application crashed and continued to do so upon restart. The way I was able to remedy this was to trash that application’s Saved Application State directory, kept in ~/Library/Saved Application State. Each application should have an entry in here using the typical property list format naming convention (e.g. com.krypted.myapp.savedState). Trash that folder with the app closed and it will open fresh and clean. To do so (continuing on with the com.krypted.myapp.savedstate example): rm -Rf ~/Saved Application State/com.krypted.myapp.savedstate Finally, it’s worth noting that some applications store certain aspects of saved states in their default domain. So if you’re clicking on a tab in a System Preference pane, keep in mind that to reset some things you might need to locate the correct plist file and nuke the settings within the plist.

Xsan + serialnumberd Troubleshooting

With Mac OS X 10.5.8 and 10.6.x, Mac OS X Server, Xsan, Final Cut Server and a number of other serialized products were switched to a whole new solution for managing serial numbers: a newly redone serialnumberd. If you run otool against serialnumberd in 10.5.7 and below you’ll notice no dependencies; it stood alone so to speak. If you run otool against the latest and greatest then you’ll notice that it has a number of dependencies that run the gambit of otherwise unthinkable services. This caused minor growing pains during the summer with multihomed network connections, maximum number of clients and other aspects of servers with certain solutions, but that got ironed out quickly with the 10.5.8v1.1 and 10.6.1. But there have been some minor issues I’ve seen still, mostly due to installer packages not holistically cleaning up old artifacts with regards to daemons that manage serial numbers (likely due to their author being concerned about the potential for other services to have dependencies on them). This is a problem that seems to manifest itself more frequently if you are running both Mac OS X Server and Xsan on the same host (which is basically all metadata controllers, etc) and have upgraded from Xsan 1.x to 2.x and potentially upgraded from Mac OS X 10.4.x to 10.5.x and ultimately to 10.6.x. The /System/Library/StartupItems/SerialNumberSupport StartupItem initially invoked the SerialNumberSupport daemon. However, that’s no longer needed for any product that I’m aware of. Therefore, you can stop it using the SystemStarter command and telling it to ‘stop SerialNumberSupport’:
SystemStarter stop SerialNumberSupport
SerialNumberSupport overall is deprecated and so if stopping it does not cause any adverse effects but does resolve some form of volume issues you might be having with your Xsan then you can also move it off somewhere that it can’t be overly troublesome, like your desktop:
mv /SystemLibrary/StartupItems/SerialNumberSupport ~/Desktop/SerialNumberSupport.OLD
Additionally, since serialnumberd is invoked by com.apple.serialnumberd.plist in /System/Library/LaunchDaemons then in many cases you do not need the /System/Library/LaunchDaemons/com.apple.SNServer.plist. If it is loaded and you are still having problems then try unloading it using launchctl. If your problems are gone then so should the SNServer, so consider moving it using:
mv /System/Library/LaunchDaemons/com.apple.SNServer.plist ~/Desktop/com.apple.SNServer.plist.OLD
These artifacts are likely left behind for a reason. So before you go removing them, check that a temporary stop of them resolves issues without adversely effecting other services. There is a good reason that not everything gets removed, although sometimes they can have unintended consequences…

Simple Networking Commands

Troubleshooting the network is faster and more thorough when it is done using the command line. Here are some simple command-line utilities that can perform a variety of tasks that can help when administering many services and multiuser environments:
  • Whoami lists the user you are currently logged in as from the command line.
  • Who lists the users logged onto your system.
  • Id shows a list of all defined users and groups whether they are actually logged in.
  • Groups <userid> shows a list of all the groups a user is in.
  • Whois lists ownership information for domains.
  • Hostname lists the name of the computer you are currently working on. You can also use hostname to set the name of the computer.
  • Ifconfig is used to show you information about your network adapter.
  • Dig is a utility for interrogating DNS servers. It is used to ask a DNS server for a type of record and provide the information for the DNS server.
  • Netstat is a highly configurable tool that can show you the status of your network interfaces. This can help administrators break down which IP addresses are connecting to servers, the name of the system using the IP address, and the ports users are accessing the server over.
  • Ping sends a request to a system. If the system supports the ability to respond, then the system will do so. Ping can be used to check the availability of a system and make sure data can reliably make it to the system being pinged.
  • Traceroute is a utility for tracing where data goes through the Internet to get to a specified destination. The traceroute command is useful when troubleshooting connectivity issues between two locations.

The Cut, Copy & Paste Daemon in OS X

Ever seen com.apple.pboard in a launchctl list?  Wondered what it did?  This is the infamous clipboard (aka – pasteboard, or on the iPhone the NSPasteboard server).  If you unload the pboard entry in launchctl then you will no longer be able to cut, copy and paste.  pboard relies on the existence of and the accessibility to the user that initiated pboard (ie – root) to have access to the /tmp folder.  Therefore, pboard will be wonky without /tmp and without pboard you won’t be able to paste things.  So, when troubleshooting cut, copy and paste issues, first verify that /tmp exists and then verify that pboard is running using the following command:
launchctl list | grep com.apple.pboard
And if it isn’t running, start it with:
launctl start com.apple.pboard

NetWare + Portlock

When you run into booting issues with NetWare it’s often a simple fix.  Move a file, edit a file, rename a file, etc.   But getting to the point where you can actually implement the fix can be a pain.  The Portlock Boot CD can come in pretty handy at this point.  It enables you to mount a file system and edit it even if the host will not boot properly. It’s not that I’m saying that you should invest more money into that crusty old NetWare environment in most cases, but in some cases it can be a saviour…

Xsan: Stripe Group Down Errors

If you are getting Stripe Group Down errors in your Xsan logs then this usually means there is a problem with your workstation accessing LUNs in the environment.  This can be an issue with a given workstation having problems seeing the SAN fabric or it can be a problem with any other system seeing the fabric.  You will notice the system having the error indicated in the logs.  Check Apple System Profiler (keep in mind Apple System Profiler sometimes requires a reboot to refresh the LUNs it has access to via Fibre Channel) to see if the indicated LUNs are present.  If all LUNs give an error (one per line) that the stripe group is down then you will typically have a bad cable, HBA, OS load or port on the switch (from the workstation or Metadata Controller).  If the error is intermittent then you may have a short in one of the above devices.  If all systems show the error then it is more likely the fiber (fibre) channel switch or the LUNs themselves having problems. Happy troubleshooting!

Setting Compatibility Mode for Windows Applications

Some applications need a little help to run. If it’s an older application and it will not launch then think about changing the compatibility mode. In order to do so, right-click on the application and click on the Compatibility tab. From here, set the compatibility mode to a previous version of Windows and then try to fire it up. Might just help…