site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com #!/bin/sh Keith _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... 2) I'm assuming that should call "launchctl unload my-agent.plist" during my installer preflight and will shut down all copies in all users and then call "launchctl load my-agent.plist" in my postfight to bring it back up for all users. Are there any other issues I need to worry about -- like if a running application has a connection to one of my agents mach ports? Installing the plists requires admin authorization, as such the scripts will be run as root. When starting/stopping the agent you need to run the command in the context of the user. You're also going to want to check for the presence of the file before unloading it in the preinstall script, else the script . My preinstall script is below for reference - if [ -f /Library/LaunchAgents/dawnAlarma.plist ]; then su $USER -c 'launchctl unload /Library/LaunchAgents/ com.buoy.dawnAlarma.plist' fi You are right to be concerned about closing the mach ports that applications could be connected to. I solved this by writing a simple wrapper around NSConnection which auto-reconnects. I'm also working on one which saves and forwards messages once the connection has been re- established, that way the wrapper client doesn't need to be concerned with the status of the link. Other than that I haven't found any issues from stopping and restarting the agent. This email sent to site_archiver@lists.apple.com