Index: http-transport.scm ================================================================== --- http-transport.scm +++ http-transport.scm @@ -557,26 +557,31 @@ (server-started (conc tmp-area "/.server-started")) (start-time (common:lazy-modification-time server-start)) (started-time (common:lazy-modification-time server-started)) (server-starting (< start-time started-time)) ;; if start-time is less than started-time then a server is still starting (start-time-old (> (- (current-seconds) start-time) 5)) - (cleanup-proc (lambda (msg) + (cleanup-proc (lambda (msg) ;; would like to use (modulo (current-seconds) 60) instead of process-id to wrap filenames (let* ((serv-fname (conc "server-" (current-process-id) "-" (get-host-name) ".log")) + (new-fname (conc "server-" (modulo (current-seconds) 60) "-" (get-host-name) ".log")) (full-serv-fname (conc *toppath* "/logs/" serv-fname)) - (new-serv-fname (conc *toppath* "/logs/" "defunct-" serv-fname))) + ;; (new-serv-fname (conc *toppath* "/logs/" "defunct-" serv-fname)) + (new-serv-fname (conc *toppath* "/logs/" new-fname)) + ) (debug:print 0 *default-log-port* msg) (if (common:file-exists? full-serv-fname) - (system (conc "sleep 1;mv -f " full-serv-fname " " new-serv-fname)) + (with-output-to-pipe "at now + 10 minutes" (lambda () + (print "mv -f " full-serv-fname " " new-serv-fname))) + ;; (system (conc "sleep 10;mv -f " full-serv-fname " " new-serv-fname)) (debug:print 0 *default-log-port* "INFO: cannot move " full-serv-fname " to " new-serv-fname)) (exit))))) - #;(if (and (not start-time-old) ;; last server start try was less than five seconds ago + (if (and (not start-time-old) ;; last server start try was less than five seconds ago (not server-starting)) (begin (cleanup-proc "NOT starting server, there is either a recently started server or a server in process of starting") (exit))) ;; lets not even bother to start if there are already three or more server files ready to go - #;(let* ((num-alive (server:get-num-alive (server:get-list *toppath*)))) + (let* ((num-alive (server:get-num-alive (server:get-list *toppath*)))) (if (> num-alive 3) (begin (cleanup-proc (conc "ERROR: Aborting server start because there are already " num-alive " possible servers either running or starting up")) (exit)))) (common:save-pkt `((action . start)