Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-07-2003, 08:25 AM   #1
Registered: Oct 2002
Location: Ayrshire, Scotland
Distribution: Suse(home) RHEL (Work)
Posts: 263

Rep: Reputation: 30
Running a browser long enough to load a page, then killing it.

I'd like to test the availability of a java page from a crontab script. I've an HTML page I can post, which I can check the response via command line ethereal to check the page is active.

To do this, I'm starting mozilla with the html page and checking for the correct response. My question is, how can I kill mozilla after the page has been served (say after 10 secs). Is there some way of assigning a variable the process ID of the instance of mozilla that I can kill again? Is there a better way to do this?

Old 10-07-2003, 09:23 AM   #2
Senior Member
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
I'm not sure what you are doing, but it sounds like you need curl or wget instead of mozilla.

In general, to kill a program after it has run some time, you need
something like timeout
(as a non-debian user there is the link for the upstream sources -- or look for the packages in your own distribution; as a debian user, run apt-get install thepackageinquestion).

In bash, the process id of the program spawned into the background is stored into the variable !, and for an useless example of how to use the variable
sleep 30s & sleep 2s ; kill $!
spawns the first (30 sec long) sleep into the background (pid stored into $!), starts to sleep 2sec and kills the first sleep when the second sleep is ready.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
10.1 official: long delay during name resolution by web browser marksouth2000 Mandriva 15 06-15-2006 11:08 AM
Killing running processes hitest SUSE / openSUSE 4 09-03-2005 02:22 PM
my web browser "mozilla fire fox" isn't rendering the page, rather opening the page amolgupta Linux - Software 2 07-26-2005 12:41 AM
Long pause during OO load mooreted Slackware 3 12-01-2004 08:33 AM
Why does OpenOffice take so long to load? mymojo Linux - Newbie 14 12-13-2003 03:55 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:06 AM.

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