On 07/15/14 11:13, Peter Hessler wrote:
On 2014 Jul 15 (Tue) at 10:25:49 +0200 (+0200), Gustav Fransson Nyvell wrote:
:On 07/15/14 09:48, Philip Guenther wrote:
:>When the process that's executing your .xinitrc exits, startx/xinit
:>will shutdown the X server and then itself exit, taking you back to
:>the non-X shell prompt.  Your .xinitrc should end with execution on
:>some program which will not exit until you want to exit X; many
:>people have it be their window manager.
:>
:>This is described in the startx(1) manpage:
:>       The .xinitrc is typically a shell script which starts many clients
:>       according to the user's preference.  When this shell script exits,
:>       startx kills the server and performs any other session
:>shutdown needed.
:>       Most of the clients started by .xinitrc should be run in the
:>       background.  The last client should run in the foreground; when it
:>       exits, the session will exit.  People often choose a session
:>manager,
:>       window manager, or xterm as the ''magic'' client.
:>
:I know all of this. The problem is why does X lose .xinitrc when
:.xinitrc (ksh) forks.
:

because the process you called stopped running.
It does not. If you mean daemon() I run it from inside a fork() so the main process never exits. You're making me uncertain so I will check this out better later.

:>Since I don't understand what problem you are trying to solve by
:>double forking or using daemon(), I cannot comment on those.
:To yield from a call and let the call run in the background.

you can't let it run in the background.  it MUST run in the foreground
ksh keeps running in the foreground but it spawns children which with daemon() tries to branch off (can't find the right word) and run in the background. So the first ksh that's running .xinitrc never dies and never goes into background. I'll probably dig around the X code later.

:>
:>
:>Philip Guenther
:>
:
:
:--
:This e-mail is confidential and may not be shared with anyone other than 
recipient(s) without written permission from sender.
:



--
This e-mail is confidential and may not be shared with anyone other than 
recipient(s) without written permission from sender.

Reply via email to