I am trying to open firefox from staf follwoing command:
staf local process start SHELL COMMAND '/usr/bin/firefox &' WAIT RETURNSTDOUT RETURNSTDERR
in Suse (SLED10) linux, but is giving:
"(firefox-bin:4524): Gtk-WARNING **: cannot open display:"
I don't know what happened.I tried with commands like ls and ifconfig.They are works fine, BUT same error while trying to open any GUI in local/remote machine.I am new to STAF so it can be some configuration issue.Tried with STAF 321/333, but same issue.
Please help me out to this issue.
Thanks in advance!!!
raj
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
FireFox is a GUI application so it requires a UI display. What display are you using? If you are setting DISPLAY=xxxx, then you need to make sure that environment variable is set prior to starting STAFProc, or set the DISPLAY environment variable when submitting the PROCESS START request, such as:
staf local PROCESS START SHELL COMMAND "/usr/bin/firefox &" WAIT RETURNSTDOUT STDERRTOSTDOUT ENV DISPLAY=<ip-address>:0.0
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How are you starting STAFProc on the SLES10 system? I could only get firefox to start if I started STAFProc while logged into the Linux desktop (as opposed to remotely logging into the system via ssh or telnet). If you start STAFProc while logged into the Linux desktop, and then run the PROCESS START request, does firefox start?
Note that when remotely logging into the system, I could not get firefox to start (outside of STAF, just by running "/usr/bin/firefox &" from the command line) even if I exported the DISPLAY.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am starting STAFProc while boot up of machine. I added following path in /etc/init.d/boot.local file.
"
PATH=/usr/local/staf/bin:$PATH; export PATH
CLASSPATH=/usr/local/staf/lib/JSTAF.jar:$CLASSPATH; export CLASSPATH
STAFCONVDIR=/usr/local/staf/codepage; export STAFCONVDIR
LD_LIBRARY_PATH=/usr/local/staf/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
/usr/local/staf/bin/STAFProc &
"
So STAFProc is already started.
I am not logging from remote machine. GUI application is not opening with in machine itself.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Note that when a STAF PROCESS is started it runs in the same environment from which STAFProc was started plus whatever new environment variables are specified via the ENV options (if any) on a PROCESS START request. So, to run Firefox (or any X application) via STAFProc, STAFProc needs to meet the requirements needed for an X application.
Firefox is an X application. So, for Firefox to run, it needs:
1) The X server must be running (e.g. xstart) at the time that STAFProc is started
(maybe you're starting STAFProc in the boot up sequence before xstart has been run?)
2) Authorization to open X programs and a X display to connect to
If you google, you'll see many hits on the "Gtk-WARNING **: cannot open display" error when trying to run Firefox (or other X applications), not related to STAF (e.g. when running via crontab, etc). I don't really think this is really a STAF question, but rather it is a question about how to run an X application when you're not logged in. Try googling to find out how you should do this. Please post the solution you find.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am starting STAFProc while boot up of machine. I added following path in /etc/init.d/boot.local file.
"
PATH=/usr/local/staf/bin:$PATH; export PATH
CLASSPATH=/usr/local/staf/lib/JSTAF.jar:$CLASSPATH; export CLASSPATH
STAFCONVDIR=/usr/local/staf/codepage; export STAFCONVDIR
LD_LIBRARY_PATH=/usr/local/staf/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
/usr/local/staf/bin/STAFProc &
"
So STAFProc is already started.
I am not logging from remote machine. GUI application is not opening with in machine itself.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
U r right Lucas. The X application is not started when STAFProc is going to start. So know I removed the all STAF path from boot.local file.
And add full path of STAFProc in startup menu.So when startup application will starts, the X application server is already running.
So now with same command I am able to launch firefox.
Thanks a lots..........
Lucas
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to open firefox from staf follwoing command:
staf local process start SHELL COMMAND '/usr/bin/firefox &' WAIT RETURNSTDOUT RETURNSTDERR
in Suse (SLED10) linux, but is giving:
"(firefox-bin:4524): Gtk-WARNING **: cannot open display:"
I don't know what happened.I tried with commands like ls and ifconfig.They are works fine, BUT same error while trying to open any GUI in local/remote machine.I am new to STAF so it can be some configuration issue.Tried with STAF 321/333, but same issue.
Please help me out to this issue.
Thanks in advance!!!
raj
FireFox is a GUI application so it requires a UI display. What display are you using? If you are setting DISPLAY=xxxx, then you need to make sure that environment variable is set prior to starting STAFProc, or set the DISPLAY environment variable when submitting the PROCESS START request, such as:
staf local PROCESS START SHELL COMMAND "/usr/bin/firefox &" WAIT RETURNSTDOUT STDERRTOSTDOUT ENV DISPLAY=<ip-address>:0.0
I tried following:
staf local PROCESS START SHELL COMMAND "/usr/bin/firefox &" WAIT RETURNSTDOUT STDERRTOSTDOUT ENV DISPLAY=172.16.1.78:0.0
This time no error came, but it is not opening the firefox. I tried with other GUI application to, but nothing different.
Following deatils may helps:
OS : SLED10 SP2
staf 333
echo $DISPLAY gives sled10-root.testing.com:0.0
where sled10-root.testing:0.0 is my hostname.
How are you starting STAFProc on the SLES10 system? I could only get firefox to start if I started STAFProc while logged into the Linux desktop (as opposed to remotely logging into the system via ssh or telnet). If you start STAFProc while logged into the Linux desktop, and then run the PROCESS START request, does firefox start?
Note that when remotely logging into the system, I could not get firefox to start (outside of STAF, just by running "/usr/bin/firefox &" from the command line) even if I exported the DISPLAY.
I am starting STAFProc while boot up of machine. I added following path in /etc/init.d/boot.local file.
"
PATH=/usr/local/staf/bin:$PATH; export PATH
CLASSPATH=/usr/local/staf/lib/JSTAF.jar:$CLASSPATH; export CLASSPATH
STAFCONVDIR=/usr/local/staf/codepage; export STAFCONVDIR
LD_LIBRARY_PATH=/usr/local/staf/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
/usr/local/staf/bin/STAFProc &
"
So STAFProc is already started.
I am not logging from remote machine. GUI application is not opening with in machine itself.
Note that when a STAF PROCESS is started it runs in the same environment from which STAFProc was started plus whatever new environment variables are specified via the ENV options (if any) on a PROCESS START request. So, to run Firefox (or any X application) via STAFProc, STAFProc needs to meet the requirements needed for an X application.
Firefox is an X application. So, for Firefox to run, it needs:
1) The X server must be running (e.g. xstart) at the time that STAFProc is started
(maybe you're starting STAFProc in the boot up sequence before xstart has been run?)
2) Authorization to open X programs and a X display to connect to
If you google, you'll see many hits on the "Gtk-WARNING **: cannot open display" error when trying to run Firefox (or other X applications), not related to STAF (e.g. when running via crontab, etc). I don't really think this is really a STAF question, but rather it is a question about how to run an X application when you're not logged in. Try googling to find out how you should do this. Please post the solution you find.
I am starting STAFProc while boot up of machine. I added following path in /etc/init.d/boot.local file.
"
PATH=/usr/local/staf/bin:$PATH; export PATH
CLASSPATH=/usr/local/staf/lib/JSTAF.jar:$CLASSPATH; export CLASSPATH
STAFCONVDIR=/usr/local/staf/codepage; export STAFCONVDIR
LD_LIBRARY_PATH=/usr/local/staf/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
/usr/local/staf/bin/STAFProc &
"
So STAFProc is already started.
I am not logging from remote machine. GUI application is not opening with in machine itself.
Sorry for the previous message.
U r right Lucas. The X application is not started when STAFProc is going to start. So know I removed the all STAF path from boot.local file.
And add full path of STAFProc in startup menu.So when startup application will starts, the X application server is already running.
So now with same command I am able to launch firefox.
Thanks a lots..........
Lucas