[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: X startup & immediate shutdown (no errors)




> -----Original Message-----
> From: Nathan E Norman [mailto:nnorman@incanus.net]
> Sent: Monday, December 16, 2002 11:59 AM
> To: debian-user@lists.debian.org
> Subject: Re: X startup & immediate shutdown (no errors)
>
>
> On Mon, Dec 16, 2002 at 11:53:12AM -0800, Charlie Reiman wrote:
> > > Can anyone please tell me why X shuts down on its own in the following
> > > situation? I want it to keep running continuously.
> > >
> > > I have no window manager installed (don't need one), I've got
> > > xserver-xfree86 installed, I can use startx fine.  So I type startx, X
> > > comes up, reads my .xsession file:
> > >
> > > #!/bin/sh
> > >
> > > /path/to/myprogram
> > >
> > > sleep 10
> > >
> > > which runs my program for ten seconds and then X shuts down by itself
> > > (no errors).  So the question becomes, how do I keep X
> running after it
> > > executes my .xsession file?  What is it looking for/to do next?
> >
> > This is what's supposed to happen. When your .xsession
> terminates so does
> > your X session. So how you prevent it from ending depends on
> what myprogram
> > does. If you are starting your program in the background, don't
> do that. If
> > you have no choice, you'll need to do something more complicated. If
> > myprogram must run asynchronously and never terminates, you
> could do this:
> >
> > while true; do sleep 100000; done
>
> Eh, wouldn't 'exec /path/to/myprogram' work?

No.

"/blahprog" will wait just as long as "exec /blahprog". The only difference
is who is waiting. "exec /blahprog" would save some memory though. If he
execs, he may even be in worse shape since if the program is async (such as
an apache start script) he won't be able to add the infinite sleep loop.




Reply to: