Keep an app running


Forum: Apps
Topic: Keep an app running
started by: rylz

Posted by rylz on Feb. 12 2007,16:16
I've seen it done before, but I want to know:

How do I keep an app running?  Mainly, I want a way to keep a program up at all times, even if a user closes it.  Here's the situation I'm setting up... I want to use DSL on some small clients in our training room.  I have it setup so, upon login, Firefox pops up and goes to our Citrix page.  I want to make it so that, if a user closes Firefox, that it will open itself back up.  

Or, if someone knows some tricks with Firefox to make it open without the Min/Max/Close buttons, that'd be great, too.  My assumption is that users in the training room will not know what to do in DSL.  Shoot, they hardly know how to use M$ Windows.   :;):

Any help would be appreciated!

Posted by mikshaw on Feb. 12 2007,16:46
Probably the simplest and messiest would be:

while true
do
pidof firefox-bin || firefox
sleep 2
done

This doesn't account for Firefox crashes where firefox-bin stays loaded. That seems to be a fairly common event.

Posted by rylz on Feb. 12 2007,17:24
OK, I slapped that in .xinitrc and it does what I want to do.  But...

I cannot type!  Why would the KB be disabled, that doesn't make sense?  Here's my current .xinitrc layout (right above "case $DESKTOP):

Code Sample
...
#dillo /usr/share/doc/dsl/getting_started.html &>/dev/null &
torsmo 2>/dev/null &

while true
do
pidof firefox-bix || firefox
sleep 2
done

case $DESKTOP in
  fluxbox )
...


I tried putting your code down below the case instance (right after "esac"), but it didn't load at all.  Do I need to incorporate it somehow (help would be needed) into the case code?

Posted by mikshaw on Feb. 12 2007,19:48
I think there's an issue with running Firefox without a window manager. There was a thread several month ago about this applied to a browser kiosk, but i don't remember if a solution was found.

What I would do if I were to use that particular code is put it in a separate script and run the script from xinitrc:
sh /path/to/script &
This would need to be put _above_ the case, so it lets .xinitrc continue on to load the window manager.

Posted by rylz on Feb. 12 2007,20:54
Quote (mikshaw @ Feb. 12 2007,14:48)
I think there's an issue with running Firefox without a window manager. There was a thread several month ago about this applied to a browser kiosk, but i don't remember if a solution was found.

What I would do if I were to use that particular code is put it in a separate script and run the script from xinitrc:
sh /path/to/script &
This would need to be put _above_ the case, so it lets .xinitrc continue on to load the window manager.

Sweet, that worked like a charm!  Thanks much for the help.
Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.