Index: server.scm ================================================================== --- server.scm +++ server.scm @@ -79,18 +79,22 @@ ;; Given a run id start a server process ### NOTE ### > file 2>&1 ;; if the run-id is zero and the target-host is set ;; try running on that host ;; (define (server:run run-id) - (let* ((target-host (configf:lookup *configdat* "server" "homehost" )) + (let* ((curr-host (get-host-name)) + (target-host (configf:lookup *configdat* "server" "homehost" )) + (logfile (conc *toppath* "/db/" run-id ".log")) (cmdln (conc (common:get-megatest-exe) - " -server - -run-id " run-id " >> " *toppath* "/db/" run-id ".log 2>&1 &"))) + " -server " (or target-host "-") " -run-id " run-id " >> " logfile " 2>&1 &"))) (debug:print 0 "INFO: Starting server (" cmdln ") as none running ...") (push-directory *toppath*) - (if target-host + (if (and target-host (not (equal? target-host curr-host))) (begin - (set-environment-variable "TARGETHOST" target-host) + (debug:print-info 0 "Starting server on " target-host ", logfile is " logfile) + (setenv "TARGETHOST" target-host) + (setenv "TARGETHOST_LOGF" logfile) (system (conc "nbfake " cmdln))) (system cmdln)) (pop-directory))) ;; kind start up of servers, wait 40 seconds before allowing another server for a given Index: utils/nbfake ================================================================== --- utils/nbfake +++ utils/nbfake @@ -1,12 +1,17 @@ #!/bin/bash -# ssh localhost "nohup $* > nbfake.log 2> nbfake.err < /dev/null" - # Can't always trust $PWD CURRWD=`pwd` +if [[ $TARGETHOST_LOGF == "" ]]; then + TARGETHOST_LOGF=NBFAKE-`date +%GWW%V.%u_%T` +fi +echo "#======================================================================" +echo "# NBFAKE Running command:" +echo "# \"$*\"" +echo "#======================================================================" if [[ $TARGETHOST == "" ]]; then - sh -c "cd $CURRWD;export DISPLAY=$DISPLAY; export PATH=$PATH; nohup $* > NBFAKE-`date +%GWW%V.%u_%T` 2>&1 &" + sh -c "cd $CURRWD;export DISPLAY=$DISPLAY; export PATH=$PATH; nohup $* > $TARGETHOST_LOGF 2>&1 &" else - ssh -n -f $TARGETHOST "sh -c \"cd $CURRWD;export DISPLAY=$DISPLAY; export PATH=$PATH; nohup $* > NBFAKE-`date +%GWW%V.%u_%T` 2>&1 &\"" + ssh -n -f $TARGETHOST "sh -c \"cd $CURRWD;export DISPLAY=$DISPLAY; export PATH=$PATH; nohup $* > $TARGETHOST_LOGF 2>&1 &\"" fi