Branch: Tag:

2001-03-17

2001-03-17 02:27:22 by Martin Stjernholm <mast@lysator.liu.se>

Create a partial pid file already in the start script, to minimize races.
Also use the pid file to avoid starting duplicate servers in the start
script.

Compatibility note: The start script now always has a fallback for the pid
file setting, to make the detection mentioned above effective. That renders
the pid file setting in Global Variables ineffective, and it has therefore
been removed. Installations which it therefore need to move it to the start
script command line, or the ROXEN_PID_FILE environment variable.

Rev: server/base_server/global_variables.pike:1.67
Rev: server/base_server/roxen.pike:1.655
Rev: server/start:1.154

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.654 2001/03/17 01:00:39 mast Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.655 2001/03/17 02:27:22 mast Exp $";      // Used when running threaded to find out which thread is the backend thread.   Thread.Thread backend_thread;
3489: Inside #if undefined(__NT__)
  {   #ifndef __NT__    if(!where) return; -  where = replace(where, ({ "$pid", "$uid" }), -  ({ (string)getpid(), (string)getuid() })); + // where = replace(where, ({ "$pid", "$uid" }), + // ({ (string)getpid(), (string)getuid() }));       r_rm(where);    if(catch(Stdio.write_file(where, sprintf("%d\n%d\n", getpid(), getppid()))))
3659:       set_u_and_gid(); // Running with the right [e]uid:[e]gid from this point on.    -  create_pid_file(Getopt.find_option(argv, "p", "pid-file", "ROXEN_PID_FILE") -  || query("pidfile")); +  create_pid_file(Getopt.find_option(argv, "p", "pid-file"));      #ifdef RUN_SELF_TEST    enable_configurations_modules();