Re: Launch a user-process from daemon
Re: Launch a user-process from daemon
- Subject: Re: Launch a user-process from daemon
- From: Eli Bach <email@hidden>
- Date: Wed, 14 Jan 2009 19:54:44 -0800
On Jan 14, 2009, at 6:56 PM, Rakesh Singhal wrote:
Hi Jason,
Thanks a lot. I have two applications, daemon application and GUI.
Constraints:
First constraint is daemon launches GUI whenever it requires. Daemon
checks for a particular USB device and then it launches the GUI. If at
boot time, device is already plugged-in then it will launch GUI in
starting only.
First, what does "launch GUI in starting only" mean?
Second, have you decided which user gets to see the GUI application
when multiple users are logged in and the device is plugged in? And
when nobody is logged in?
Second I can not make changes in GUI code, it will be launched by
daemon application.
If I use daemon as an agent then it is able to launch GUI, but I can
not use my daemon application as an agents cause I want two things:
1. Only one daemon for all logins.
2. I do not want system to close daemon application, when any user
logs out.
You would probably find the answer if you did some searching on
lists.apple.com, as bizarrely, other people have done what you appear
to want to do.
However, to do your design work for you, I would say you probably want
to create two daemons.
1 daemon, executed using launchd from an entry in /Library/
LaunchDaemons/
This will run in the login context, and should remain running always
1 daemin, executed using launchd from an entry in /Library/
LaunchAgents/ (or possibly ~/Library/LaunchAgents/ if you only want
the GUI launched for a specific user)
This will run when each user logs in (so, if multiple users are logged
in, multiple processes will be executed).
This will automatically be terminated when the user logs out, and is
run in the user context.
This process should communicate with the 'master' daemon, and then
launch the GUI application when appropriate.
The methods needed to communicate between the master daemon and the
per-user daemons have been mentioned on this thread, and also can be
found searching lists.apple.com.
Eli
_______________________________________________
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