Running Firefox in a While-loop for Kiosk

Zach Carter linux at zachcarter.com
Wed Jul 18 20:40:35 CEST 2007


On Tuesday 17 July 2007 08:33:02 pm alexgill at tekwerx.biz wrote:
> Hello List,
> 
> I have an LTSP setup with Firefox running atop XFCE (xfwm and xfdesktop) for the purpose of providing kiosk functionality.  My goal is to have FF always up -- and so it'd re-open after being closed.
> 
> I'm using the "autostart" feature to launch the script at startup:
>     while true; do /usr/bin/firefox; done;
> Sometime this gets out of hand and will start launching ad infinitum....  But other times, it works nicely.  
> 
> Has anyone every tried having such a large app loop like this?  Any advice on getting Firefox to always relauch in a sane and reliable way??

How about something like this:

while true
do
  if $(pgrep firefox > /dev/null)
  then
    # wait a few secs before checking again
     sleep 5
  else
     echo firefox not running.  restarting.....
     /usr/bin/firefox
    # give it a chance to startup
    sleep 10
  fi
done


-Zach



More information about the Xfce mailing list