Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2009, Roxen IS.   //   // The Roxen WebServer main program.   //   // 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.1123 2012/09/27 15:25:29 grubba Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.1124 2012/10/03 13:16:02 grubba Exp $";      //! @appears roxen   //!   //! The Roxen WebServer main program.      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN
Roxen.git/server/base_server/roxen.pike:5587:      void create_pid_file(string where)   {   #ifndef __NT__    if(!where) return;   // where = replace(where, ({ "$pid", "$uid" }),   // ({ (string)getpid(), (string)getuid() }));       object privs = Privs("Deleting old pid file.");    r_rm(where); +  privs = 0;       mixed err;       // Note: The server lock file is often created by the start script, but    // there is a race, so this code is here for paranoia reasons.    if (!Stdio.exist(sprintf("/var/run/roxen-server.%d.pid", getpid())) &&    !Stdio.exist(sprintf("/tmp/roxen-server.%d.pid", getpid()))) {    // NB: The following won't work if there's a wrapper process    // for Roxen (eg started via gdb, truss or valgrind),    // but that shouldn't matter much, since the pid lock file
Roxen.git/server/base_server/roxen.pike:5612: Inside #if undefined(__NT__)
   sprintf("/var/run/roxen-server.%d.pid", getpid()));    } && (err = catch {    // And then /tmp/.    hardlink(sprintf("/tmp/roxen-start.%d.pid", getppid()),    sprintf("/tmp/roxen-server.%d.pid", getpid()));    })) {    report_debug("Cannot create the pid lock file %O: %s",    sprintf("/tmp/roxen-server.%d.pid", getpid()),    describe_error(err));    } -  } +     privs = 0; -  +  }    if(err = catch {    Stdio.write_file(where, sprintf("%d\n%d\n", getpid(), getppid()));    })    report_debug("Cannot create the pid file %O: %s",    where, describe_error (err));   #endif   }      Pipe.pipe shuffle(Stdio.File from, Stdio.File to,    Stdio.File|void to2,