| Sign In/My Account | View Cart |
| Article: |
Start Me Up: Writing and Understanding OS X StartupItems | |
| Subject: | Stop | |
| Date: | 2003-10-21 18:02:30 | |
| From: | anonymous2 | |
| So have they actually added support for running these things at shutdown yet, or is this still unimplemented? | ||
Showing messages 1 through 8 of 8.
If you need a "nice" (ie orderly) shutdown, script it (shell, applescript, automator workflow, or any combination).
#!/bin/sh
. /etc/rc.common
StartService ()
{
# what to do on boot (can be empty)
}
StopService ()
{
# what to do on shutdown (can be empty)
}
RunService "$1"
This file has to be executable, i.e. chmod a+x filename. Then create a file by the name StartupParameters.plist with the following contents:
StartupParameters.plist
{
Description = "Name of your service goes here";
Provides = ("Whatever your service provides goes here");
Uses = ("Disks");
}