Re: Launching a GUI using execl()
Re: Launching a GUI using execl()
- Subject: Re: Launching a GUI using execl()
- From: Rakesh Singhal <email@hidden>
- Date: Wed, 25 Feb 2009 05:25:41 +0530
Thanks a lot. Sorry for trouble. My answers are as follows:
1. Child process is not going to run as root. My intention is child to
run as user. I am setting the uid and gid of current user using
setuid(), seteuid(), setgid() and setegid() APIs.
3. Before launching the GUI, I am checking that if any user is logged
in or not. If not then I do not launch.
4. I want to start my GUI app through a background app. I am using
daemon app for this purpose and for some other functionality also. I
choose daemon cause it does not get terminated when user logs out,
that I need for other functionality.
To launch GUI, I can use launchAgents then I will need to use both
daemon and agents. But now I have one query that when user logs out
the agents will be terminated and when user logs in again then?
Regards
On Wed, Feb 25, 2009 at 4:58 AM, Jamison Hope <email@hidden> wrote:
> On Feb 24, 2009, at 5:58 PM, Rakesh Singhal wrote:
>
>> Sorry, if I had to put in same thread. It is related to same topic but
>> it is a different issue. I am not that much experienced programmer
>> like most of them are here. I will take care next time.
>
> Dude, respectfully, it's not a different issue. For months now you've been
> asking questions which all boil down to "I want to launch a GUI app from a
> daemon and XXXXX isn't working. Help?"
>
> Every time, people have said "That's because you shouldn't be launching a
> GUI from a daemon. Read TN2083. What are you trying to do?" And you never
> answer their questions. And yet here like a sucker I'm going to ask you some
> questions:
>
> 1. If a process running as root forks/execs another process, that child
> process is also going to run as root. Is it really your intention to run
> your GUI app as root, and not as the user who happens to be
> fast-user-switched in at the moment (if any)? If the answer to that question
> is "Yes", then goto 2. If "No", goto 3.
>
> 2. So you want your GUI to run as root. Why? DON'T DO THAT. What are you
> trying to accomplish? You should design your GUI app to run as a normal
> user, launched from within that user's login session, and to use
> Authorization Services to get any special privileges it needs. Goto 4.
>
> 3. So you want your GUI to run as a user, then. Good. What if there is no
> user logged in right now? What if there are several? Are you just going to
> hope that the active console session belongs to the appropriate user? What
> are you trying to accomplish? Goto 4.
>
> 4. What are you trying to accomplish? Please give a higher-level goal than
> "to launch a GUI from a daemon". If that's your only answer, I doubt
> anybody's going to be able or willing to help you further.
>
> --
> Jamison Hope
> The PTR Group
> www.theptrgroup.com
>
>
_______________________________________________
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