511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
|
(not server-starting))
(begin
(debug:print-info 0 *default-log-port* "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*))))
(if (> num-alive 3)
(begin
(debug:print 0 *default-log-port* "ERROR: Aborting server start because there are already " num-alive " possible servers either running or starting up")
(exit))))
(let* ((th2 (make-thread (lambda ()
(debug:print-info 0 *default-log-port* "Server run thread started")
(http-transport:run
(if (args:get-arg "-server")
(args:get-arg "-server")
"-")
|
|
>
>
>
>
|
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
|
(not server-starting))
(begin
(debug:print-info 0 *default-log-port* "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*))))
(if (> num-alive 3)
(let* ((serv-fname (conc "server-" (current-process-id) "-" (get-host-name) ".log"))
(full-serv-fname (conc *toppath* "/logs/" serv-fname))
(new-serv-fname (conc *toppath* "/logs/" "defunct-" serv-fname)))
(debug:print 0 *default-log-port* "ERROR: Aborting server start because there are already " num-alive " possible servers either running or starting up")
(if (common:file-exists? serv-fname)
(system (conc "sleep 1;mv -f " full-serv-fname " " new-serv-fname)))
(exit))))
(let* ((th2 (make-thread (lambda ()
(debug:print-info 0 *default-log-port* "Server run thread started")
(http-transport:run
(if (args:get-arg "-server")
(args:get-arg "-server")
"-")
|