932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
|
(let* ((host-type (args:get-arg "-adjutant")))
(launch:setup) ;; dang it, wish this wasn't needed
(print "Running the adjutant!")
(let loop ((wait-count 0))
(if (< wait-count 10) ;; 6 x 10 seconds = one minute
(let* ((dat (rmt:no-sync-take-job host-type)))
(match dat
((id ht vars exekey cmdline state event-time last-update)
(call-with-environment-variables
(with-input-from-string vars read)
(lambda ()
(system cmdline)))
(loop 0))
(else
(thread-sleep! 10)
(loop (+ wait-count 1)))))
(print "I'm bored. Exiting.")))
;; (adjutant-run (args:get-arg "-ajutant") rmt:no-sync-take-job)
(set! *didsomething* #t)))
(if (or (args:get-arg "-list-servers")
(args:get-arg "-kill-servers"))
(let ((tl (launch:setup)))
|
|
>
>
>
>
|
|
|
|
|
|
|
|
|
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
|
(let* ((host-type (args:get-arg "-adjutant")))
(launch:setup) ;; dang it, wish this wasn't needed
(print "Running the adjutant!")
(let loop ((wait-count 0))
(if (< wait-count 10) ;; 6 x 10 seconds = one minute
(let* ((dat (rmt:no-sync-take-job host-type)))
(match dat
((id ht vars exekey cmdline state event-time last-update)
(let ((vars-alist (with-input-from-string vars read)
))
(print "Vars:")
(pp vars-alist)
(call-with-environment-variables
vars-alist
(lambda ()
(system cmdline))))
(loop 0))
(else
(thread-sleep! 10)
(loop (+ wait-count 1)))))
(print "I'm bored. Exiting.")))
;; (adjutant-run (args:get-arg "-ajutant") rmt:no-sync-take-job)
(set! *didsomething* #t)))
(if (or (args:get-arg "-list-servers")
(args:get-arg "-kill-servers"))
(let ((tl (launch:setup)))
|