Re: Launch a user-process from daemon
Re: Launch a user-process from daemon
- Subject: Re: Launch a user-process from daemon
- From: Rakesh Singhal <email@hidden>
- Date: Tue, 27 Jan 2009 23:52:08 +0530
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 <email@hidden> 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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden