[Tfug] Exiting a script when exiting X

John Gruenenfelder jetpackjohn at gmail.com
Sun Dec 4 00:04:11 MST 2011


On Thu, Dec 1, 2011 at 17:28, John Gruenenfelder <jetpackjohn at gmail.com> wrote:
>
> Rich,
>
> I didn't mention it in the original email, but this is actually how I
> am running the script.  I know that this definitely didn't work
> properly (the exit cleanup, that is) with Gnome 2.  I'll see if it
> behaves better with Gnome 3 and get back.
>
> However, I'd still like to find a more general solution.  While
> hacking the script, I ran and killed it from the command line within X
> numerous times and, of course, that will bypass Gnome's session
> management.  And, while I don't hate Gnome 3 (sans Unity) nearly as
> much as many other people, its lack of customization options could
> have me switching to XFCE is the near future.

Rick,

Yes, the job control provided by Gnome 3's session manager seems to be
doing a better job than Gnome 2's did.  I've tried starting my script
from various locations and then logging out and back in.  I don't seem
to have the issue with orphan processes that I did before.

That said, at the same time I have also mostly rewritten the script
and this may account for it behaving better, too.  Before it was a
collection of about ten files or so.  Now, I've rewritten it to have
most of those external scripts be shell functions.  I also
consolidated the various versions of the script into one, controllable
from a settings file.  With fewer processes spawned, there are fewer
that can be left behind.

Also, the forum link you provided showed how to use a lock file
properly from within a script to control multiple executions.  This is
a better solution than just running killall, so I'm using that now.
Thanks.

Again, it's still not a general solution, but it is definitely working
well enough for now.  Add to that the story about Gnome Shell
Extensions recently seen on Slashdot, and now I have Gnome 3 behaving
much more closely to how I would like it (meaning I can put off
switching desktop environments for the time being).


-- 
--John Gruenenfelder    Systems Manager, MKS Imaging Technology, LLC.
Try Weasel Reader for Palm OS  --  http://weaselreader.org
"This is the most fun I've had without being drenched in the blood
of my enemies!"
        --Sam of Sam & Max




More information about the tfug mailing list