Don't write out the PID file all the time
authorJamie Cameron <jcameron@webmin.com>
Fri, 24 Apr 2009 19:49:49 +0000 (19:49 +0000)
committerJamie Cameron <jcameron@webmin.com>
Fri, 24 Apr 2009 19:49:49 +0000 (19:49 +0000)
miniserv.pl

index 98ab678..5042f02 100755 (executable)
@@ -537,7 +537,6 @@ $SIG{'USR1'} = 'miniserv::trigger_reload';
 $SIG{'PIPE'} = 'IGNORE';
 local $remove_session_count = 0;
 $need_pipes = $config{'passdelay'} || $config{'session'};
-$last_pid_time = time();
 while(1) {
        # wait for a new connection, or a message from a child process
        local ($i, $rmask);
@@ -584,12 +583,6 @@ while(1) {
                }
        local $time_now = time();
 
-       # Write the PID every 10 seconds
-       if ($time_now - $last_pid_time > 10) {
-               &write_pid_file();
-               $last_pid_time = $time_now;
-               }
-
        # Clean up finished processes
        local $pid;
        do {    $pid = waitpid(-1, WNOHANG);