Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create my own Linux distro in LiveCD format. I have put a webserver in my Linux LiveCD, and make it automatically startup during boot time.

I have made the LiveCD to auto-login to desktop environment without requiring user to type in their password.

Now, I would like to configure the web browser to automcatically pop-up during startup and show the homepage of the webserver.

I have tried different methods but i found that when user boot up the LiveCD, most of the time the desktop environment and the web browser will be shown before the webserver finished starting up. As a result, the web browser will show an error page "webpage not found/not available".

After a few seconds (after the webserver finished starting up), if the user click at the refresh button, they will be able to see the homepage.

How can I make sure that the webserver has been started up before the desktop environment is shown to the user?


share|improve this question

You can, for example, use some sort of script like this:


    # Check existence of webserver pidfile

    if [ -f $pidfile ]; then
            echo "Pidfile exists"
            < OPEN BROWSER >
            echo "Web Server isn't started"
share|improve this answer

A shell script similar to one posted by @hangover would work.

If this is only a race about couple of seconds, then another approach would be to create a local HTML file and set that as a start-up page for your web browser with a path like file:///var/www/html/localhost/startingup.html. The page itself would say "Please wait while I'm finishing the startup, this will take only a short moment", and then forward itself to your actual web page after, say, 30 seconds.

     <title>Starting up...</title>
     <meta http-equiv="refresh" content="30;">
     <h1>Please wait, I'm still starting up.</h1>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.