################################################# # Function definitions for ultrix dump type ################################################# proc ultrix_dump {host atom level} { global sessionID tmpdir set hostlogfile $tmpdir/BURTlog.${sessionID}.$host if { [string compare $atom "/"] == 0 } { append hostlogfile ".root" } else { regsub -all {/} $atom "." newatom append hostlogfile "$newatom" } append hostlogfile ".$level.ultrix" set dumpfd [open "|/usr/ucb/rsh $host -n \"/bin/dump ${level}uf - $atom\" 2> $hostlogfile" {RDONLY NONBLOCK}] set stderrfd [open $hostlogfile r] return [list $dumpfd $stderrfd] } proc ultrix_cleanup {host atom level} { global sessionID tmpdir set hostlogfile $tmpdir/BURTlog.${sessionID}.$host if { [string compare $atom "/"] == 0 } { append hostlogfile ".root" } else { regsub -all {/} $atom "." newatom append hostlogfile "$newatom" } append hostlogfile ".$level.ultrix" catch {file delete $hostlogfile} } proc ultrix_check {host atom level line} { return [regexp {error|Unknown|EXITED|ATTENTION|abort|Bad} $line] } proc ultrix_recover {host atom level} { return [open "$host.$level.burt" w] } proc ultrix_schedule {line} { global logfilefd rshStatus foreach {host level type} $line {} if { $rshStatus(running) >= 10 } { vwait rshStatus(running) } scheduleHostWithRsh $host $level $type /bin/rsh -n ultrixRshProcess incr rshStatus(scheduled) # foreach atom [hosttoatomlist $host /bin/rsh -n] { # schedule add $host $atom $level $type # puts $logfilefd "BURT: Scheduling $host $atom $level $type" # } } proc ultrixRshProcess { hostfd host level type cmd } { global rshStatus logfilefd if {![eof $hostfd]} { gets $hostfd line if {![regexp {^#} $line]} { if { [lindex [split $line :] 3] >= 1 } { set atom [lindex [split $line :] 1] puts $logfilefd "BURT: Scheduling $host $atom $level $type \ [burtTime]" schedule add $host $atom $level $type incr rshStatus($host-$cmd-count) } } } else { set rshStatus($host-$cmd) fileEventFired } }