Index: dbfile.scm ================================================================== --- dbfile.scm +++ dbfile.scm @@ -592,11 +592,11 @@ ;; host port pid starttime status mtversion (lambda (res . row) (cons row res)) '() nsdb - "SELECT (host,port,pid,starttime,status,purpose,dbname,mtversionn FROM processes WHERE host=? AND pid=?;" + "SELECT host,port,pid,starttime,status,purpose,dbname,mtversion FROM processes WHERE host=? AND pid=?;" host pid))) (if (null? res) #f (car res)))) Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -541,10 +541,15 @@ ;; immediately set MT_TARGET if -reqtarg or -target are available ;; (let ((targ (or (args:get-arg "-reqtarg")(args:get-arg "-target")))) (if targ (setenv "MT_TARGET" targ))) +;; set the purpose field in procinf + +(procinf-purpose-set! *procinf* (get-purpose args:arg-hash)) +(procinf-mtversion-set! *procinf* megatest-version) + ;; The watchdog is to keep an eye on things like db sync etc. ;; ;; TODO: for multiple areas, we will have multiple watchdogs; and multiple threads to manage ;;(define *watchdog* (make-thread Index: tcp-transportmod.scm ================================================================== --- tcp-transportmod.scm +++ tcp-transportmod.scm @@ -482,11 +482,25 @@ (run-thread (make-thread (lambda () (tt:keep-running ttdat dbfname dbstruct))))) (thread-start! tcp-thread) (thread-start! run-thread) - (thread-join! run-thread) ;; run thread will exit on timeout or other conditions + + (procinf-port-set! *procinf* (tt-port ttdat)) + (let* ((areapath (tt-areapath ttdat)) + (nosyncdbpath (conc areapath"/.mtdb"))) + (dbfile:with-no-sync-db + nosyncdbpath + (lambda (nsdb) + (dbfile:insert-or-update-process nsdb *procinf*))) + + (thread-join! run-thread) ;; run thread will exit on timeout or other conditions + (procinf-status-set! *procinf* "done") + (dbfile:with-no-sync-db + nosyncdbpath + (lambda (nsdb) + (dbfile:insert-or-update-process nsdb *procinf*)))) (debug:print 0 *default-log-port* "Exiting now.") (exit)))))) (define (tt:keep-running ttdat dbfname dbstruct) ;; verfiy conn for ready