Link to home
Start Free TrialLog in
Avatar of pkgoyal
pkgoyalFlag for India

asked on

Launching firefox browser just after dhcp request on Linux

Hello,
I'm developing linux based application. After entering into init 5 level, system make dhcp request to assign ip address to ethernet card. Just after that I need to launch firefox browser before any other service comes up. After Im done(after closing the browser), then I would like network service initailization continued.
I don't know what extact command or sequence of commands I need to execute to launch the browser.
and where extactly (file and place)I need to call these commands.

Please advise.
Avatar of arrkerr1024
arrkerr1024
Flag of United States of America image

What distribution are you using?  You'd have to launch a window manager before you can launch firefox...
Avatar of pkgoyal

ASKER

I'm using fedora core 6. Yeah I know that I need to launch window manager.. but how should I do that...
what command should I issue to launch both window manager as well browser...
ASKER CERTIFIED SOLUTION
Avatar of agriesser
agriesser
Flag of Austria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What are you trying to do?  

You really should not be using a browser (or any other user-mode UI program)  in the middle of system initialization.  It has far too many dependencies on other services which may not yet be started.  

The init scripts which are part of system startup are run as root.  You really don't want to run user applications, such as firefox, as root.  There are just too many security holes.

If there is specific information which you need from a web server, look at using wget and other command line tools to obtain that info. This can be used to create a script which can be added to /etc/init.d.
Avatar of pkgoyal

ASKER

This is a kind of thin client... it will have very limited resouces and authentication will be done by server.
User bowser will be launched as root just after client gets ip via dhcp. and user is supposed to enter user name and password and after this only I need to start rest of required services.
So kindly tell me where (source code or script,) where  ip assignmnet via dhcp takes place so that just after that I can write code to launch the browser.
That depends on the linux distribution you're using. Usually, there are init scripts in /etc/init.d, one of them might be called "networking" or "network" or something like this.
After this script has completed, you should got an IP address and can start the browser/X Server then.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pkgoyal

ASKER

I just tried startx /usr/bin/firefox (as suggested by agriesser )after booting my system in init level 3 after login into the system as root.
It started the window manager and launched the browser as well. But when I closed the brwoser window I did not get  the same command prompt(why ?) from where I invoked the command rather I got blank screen and I had to restart my machine.
Avatar of pkgoyal

ASKER

For eager question: to start brwoser is requirement from my customer. I've to do that....
Are you booting in framebuffer mode? That usually happens when the console framebuffer is enabled and the Xorg driver has troubles to get the framebuffer mode back up after the X Server has quit.

@eager: As far as I understand, it's a thinclient, so no data on it, no security stuff.
Besides that, when the browser has been quit at the end of the initialization process, there's still the console login which needs to be passed to get access to this system.

I could even think of a script that shuts down the thinclient when the browser has quit.
Avatar of pkgoyal

ASKER

Are you booting in framebuffer mode?
What is framebuffer mode.
The framebuffer mode on the console allows for having fancy graphics while booting (e.g. your distribution's logo, a progress bar, etc.) and gets you highter resolutions (you're not limited to the 80x25 lines in plain text mode).

To see if you're booting in framebuffer mode, issue the command `cat /proc/cmdline` and check for the existance of a "vga=" parameter. If it's set to something else than "normal", you're booting in framebuffer mode.

To make your system boot in console mode, edit your bootloaders configuration file (/boot/grub/menu.lst usually) and replace the "vga=something" with "vga=normal" or simply remove the "vga=..." option at all.
Any updates on this one?