Running a Shell Script on Shutdown via launchd
Since startup items and rc commands are both deprecated (and in many cases not working at all) on OS X in favour of launchd , I'd like to find out what the correct way would be to setup a shell script that runs on logout/shutdown. For a startup item it was possible to create a shell script that looked something like: #!/bin/sh StartService() { echo "Started." } StopService() { echo "Stopped." } RunService "$1" But the RunService command isn't supported when running a script from launchd , and I'm not sure it's meant to be used anymore anyway. If possible, I'd like to create a shell script that