greyhound.php
changeset 16 23d4cf2f183b
parent 15 2adca0f363fd
child 17 66c3eb4cdc4c
equal deleted inserted replaced
15:2adca0f363fd 16:23d4cf2f183b
    79 // signal handler
    79 // signal handler
    80 function sigterm($signal)
    80 function sigterm($signal)
    81 {
    81 {
    82   global $httpd;
    82   global $httpd;
    83   status("Caught SIGTERM, cleaning up.");
    83   status("Caught SIGTERM, cleaning up.");
    84   @socket_close($httpd->sock);
    84   exit(0);
    85   exit();
       
    86 }
    85 }
    87 
    86 
    88 status('initializing playlist');
    87 status('initializing playlist');
    89 
    88 
    90 // init playlist object
    89 // init playlist object
   131       if ( is_dir( GREY_ROOT . "/themes/$dir" ) )
   130       if ( is_dir( GREY_ROOT . "/themes/$dir" ) )
   132         load_theme($dir);
   131         load_theme($dir);
   133     }
   132     }
   134   }
   133   }
   135   $httpd->allow_dir_list = true;
   134   $httpd->allow_dir_list = true;
   136   $httpd->allow_fork = ( $allow_fork ) ? true : false;
   135   $httpd->allow_fork = false; // ( $allow_fork ) ? true : false;
   137   $httpd->default_document = 'index';
   136   $httpd->default_document = 'index';
   138   
   137   
   139   status("Entering main server loop - ^C to interrupt, listening on port $port");
   138   status("Entering main server loop - ^C to interrupt, listening on port $port");
   140   $httpd->serve();
   139   $httpd->serve();
   141 }
   140 }