LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-16-2007, 09:22 AM   #1
gauravtiwari21
LQ Newbie
 
Registered: Aug 2007
Posts: 5

Rep: Reputation: 0
How to start mozilla from a service in linux


Hi all,
I am facing a problem in launching mozilla browser from a program which is running in a service.I have a java program which opens a port and launches the mozilla browser from the terminal or CUI mode. When I run this program through a shell script everything works fine and the browser is easily started but when I tried to run the same program from a service, it opened the port but did not launch the browser.That means the service was running fine but still it could not launch the browser due to some unknown reason. Just to check the things I executed the runmozilla.sh from the service it gave an error as "GTK WARNING : Cannot open display" but the same command ran successfully to launch the browser when I tried it from the terminal.I am working on a Redhat Linux 8.0 and an RHEL 4, I need to create a service or something similar so that the task can be accomplished automatically at boot time or after the GUI is loaded, I am stuck with this therefore pls suggest some solutions.

Thanks

Last edited by gauravtiwari21; 10-16-2007 at 09:38 AM.
 
Old 10-16-2007, 09:46 AM   #2
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
I don't know that I can tell you exactly how to do this, but there are at least two issues here.

First you must set the DISPLAY variable to the display the browser is to use. For example

Code:
DISPLAY=:0
will display on the first display.

Secondly, (and this is where my knowledge is really shaky) is that the browser is going to have to authenticate to the X server. I have done something perhaps a little in similar in that I have ip-up.local, which is running as root, pop an xterm up on a display. Because of where this was called from, the DISPLAY variable is already set. I then have the script su to the user that owns that display to pop up the xterm. I am not sure if that will be sufficient for you, but hopefully this is enough info to at least get you started.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
when i try to start samba pdc's smb service nmbd failed to start . sandeepchau123 Linux - Newbie 2 10-20-2007 01:59 PM
remotely start/stop service on WinNT PC from Linux cuzality Linux - Software 0 09-01-2004 01:48 PM
Is it possible to start stop and restart a linux service from a webpage? psychodreams Linux - Newbie 3 04-27-2004 01:24 PM
Start service HiGate Linux - General 3 01-25-2003 04:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration