283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
|
;; Start the server - can be done in conjunction with -runall or -runtests (one day...)
;; we start the server if not running else start the client thread
;;======================================================================
(if (args:get-arg "-server")
(begin
(debug:print 2 "Launching server...")
(server:launch)))
(if (args:get-arg "-list-servers")
;; (args:get-arg "-kill-server"))
(let ((tl (setup-for-run)))
(if tl
(let ((servers (open-run-close tasks:get-all-servers tasks:open-db))
(fmtstr "~5a~8a~8a~20a~20a~10a~10a~10a~10a\n")
|
>
>
>
>
>
>
>
|
>
>
>
>
>
|
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
|
;; Start the server - can be done in conjunction with -runall or -runtests (one day...)
;; we start the server if not running else start the client thread
;;======================================================================
(if (args:get-arg "-server")
(begin
(debug:print 2 "Launching server...")
;; (change-directory "/")
(let ((fd-r (file-open "/dev/null" open/rdonly))
(fd-w (file-open "/dev/null" open/wronly)))
(duplicate-fileno fd-r 0)
(duplicate-fileno fd-w 1)
(file-close fd-r)
(file-close fd-w))
(let ((child-pid (process-fork (lambda ()(server:launch)))))
(if (not (zero? child-pid))
(exit 0)))
(create-session)
(duplicate-fileno 1 2)
(void)))
(if (args:get-arg "-list-servers")
;; (args:get-arg "-kill-server"))
(let ((tl (setup-for-run)))
(if tl
(let ((servers (open-run-close tasks:get-all-servers tasks:open-db))
(fmtstr "~5a~8a~8a~20a~20a~10a~10a~10a~10a\n")
|