Branch: Tag:

2001-03-17

2001-03-17 01:00:39 by Martin Stjernholm <mast@lysator.liu.se>

Add a newline to the end of the pid file, to make it more easily
parseable by scripts. Some other minor tinkering.

Rev: server/base_server/roxen.pike:1.654

4:   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.      // ABS and suicide systems contributed freely by Francesco Chemolli - constant cvs_version="$Id: roxen.pike,v 1.653 2001/03/17 00:05:22 per Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.654 2001/03/17 01:00:39 mast Exp $";      // Used when running threaded to find out which thread is the backend thread.   Thread.Thread backend_thread;
384:   }      // Function that actually shuts down Roxen. (see low_shutdown). - private static void really_low_shutdown(int exit_code) + private void really_low_shutdown(int exit_code)   {    // Die nicely. Catch for paranoia reasons -  +  catch +  {   #ifdef THREADS -  catch( stop_handler_threads() ); +  stop_handler_threads();   #endif /* THREADS */ -  +  if (exit_code) +  report_notice("Restarting Roxen.\n"); +  else +  report_notice("Shutting down Roxen.\n"); +  };    exit( exit_code ); // Now we die...   }    - static private int _recurse; + private int _recurse;      // Shutdown Roxen   // exit_code = 0 True shutdown   // exit_code = -1 Restart - private static void low_shutdown(int exit_code) + private void low_shutdown(int exit_code)   { -  +     if(++_recurse > 4)    {    catch {
416:       catch(stop_all_configurations());    destruct(cache); -  catch -  { -  if (exit_code) -  report_notice("Restarting Roxen.\n"); -  else -  report_notice("Shutting down Roxen.\n"); -  }; +     -  +     call_out(really_low_shutdown, 0.1, exit_code);   }   
3495: Inside #if undefined(__NT__)
   ({ (string)getpid(), (string)getuid() }));       r_rm(where); -  if(catch(Stdio.write_file(where, sprintf("%d\n%d", getpid(), getppid())))) +  if(catch(Stdio.write_file(where, sprintf("%d\n%d\n", getpid(), getppid()))))    report_debug("I cannot create the pid file ("+where+").\n");   #endif   }
3583:   array argv;   int main(int argc, array tmp)   { -  tmp = 0; +     argv = tmp; -  +  tmp = 0;    slowpipe = ((program)"base_server/slowpipe");    fastpipe = ((program)"base_server/fastpipe");    dump( "base_server/slowpipe.pike" );