Re: Launch a user-process from daemon
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=JH8vVzxAnHYrSy1PG+eqQP8I9HUYBJnMwaulXOTDodQ=; b=VzUCIq876WieOyYTiQ2wtkhub4sMFJ+F/PewZbC9QwNM47lcDoGGk+NCqwYMv4wjxw 6yKh38FGJ9OP2sR/5zggk9xBXff34qfhKAtihId+TqLLP+vBzPhx2B3Y7CYaQ0kULMOX Me/7sRataLHI1Ly8UdS5AlDRqsz2XdVLimFFc= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=cPIgfmUDX0XiuZe2/kJ+5HyAbmni3zRef53c73hWY5W1q0di0RZrka3ysNf1L50pMU iRWyZCDfLolvktRlt9MTMqsDkNAfyVQP4qqwXzvGfHKIT20JKkZrR7xzwaH3SqFrLod1 zpD9ow9QQT57juVilboZtt/aiR3V0Il9EYaXc= It is very simple. There is nothing like daemon and not related to usb device. One process is launching another GUI application thats all. Only to launch the GUI, I am looking for different APIs. Obviously I have to support both 10.4 and 10.5. 1. LSOpenApplication() 2. execl() 3. system() Regards On Tue, Jan 27, 2009 at 8:07 PM, Marc Epard <mepard@me.com> wrote:
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.
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.
Here is what seems to be the case:
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.
Here's what's not clear:
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?
Here are my suggestions:
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.
-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... This email sent to site_archiver@lists.apple.com
participants (1)
-
Rakesh Singhal