Re: Launch a user-process from daemon
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Jan 27, 2009, at 7:47 AM, Rakesh Singhal wrote: Now I am able to launch the GUI using execl() but when I close the process, the GUI also gets closed. I think, its good to use this API but GUI is not working independetly. Please advice me. Here is what seems to be the case: Here's what's not clear: Here are my suggestions: -Marc _______________________________________________ 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... You still haven't answered Shawn's questions. We can help you better if you tell us what you are trying to do at a high level. 1. You want to launch a particular GUI application when a particular USB device is connected. 2. You did not write the GUI application and can't change it. 1. Can you require 10.5 or do you need to support 10.4 or earlier versions of Mac OS X? 2. Do you really need a daemon that keeps running across user logins? Is there some state being maintained by the daemon or is its only purpose to launch the GUI app? If you can require 10.5, use a Launch Agent that runs in each GUI login session. In the agent, use IOKit to register for notifications when USB devices are attached. When notified that your mysterious device is connected, use Launch Services to launch the third party app. For systems prior to 10.5, use a Login Item instead of a Launch Agent. You might need to spend a DTS incident to find out how to add a Login Item for every user. If you really do need a non-GUI, long-running daemon, have each Launch Agent (or Login Item) talk to your daemon using your favorite IPC mechanism. This email sent to site_archiver@lists.apple.com
participants (1)
-
Marc Epard