[launchd-dev] Possible to work around 10.4 LaunchAgent bugs?

Sidney San Martín s at sidneysm.com
Tue Aug 11 10:38:08 PDT 2009


My current project needs an agent to run whenever a user is logged in.  
A LaunchAgent would be perfect for this, and in 10.5, it is.

If I can't use a LaunchAgent on 10.4, the alternative isn't so  
appealing:
*  I'd need to use barely-supported procedures to install a global  
login item.
*  There would be separate install, update, and uninstall code paths  
for 10.4, 10.5+, and a 10.4 to 10.5+ migration
*  The daemon would need to be able to detect a migration from 10.4 to  
10.5+ and convert the global login item to a LaunchAgent on first boot

That's a little more complexity (and potential for a failure) than I  
want. Has anyone found workarounds for the issues in 10.4? Can I  
program my agent to handle the error conditions that lead to a failed  
launch (detect non-gui sessions, for instance) and exit gracefully  
before launchd rips it out?


More information about the launchd-dev mailing list