################################################# # Function definitions for ufs dump type ################################################# proc ufs_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.ufs" set dumpfd [open "|/s/std/bin/rsh $host -n \"/etc/dump ${level}uf - $atom\" 2> $hostlogfile" {RDONLY NONBLOCK}] set stderrfd [open $hostlogfile r] return [list $dumpfd $stderrfd] } proc ufs_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.ufs" catch {file delete $hostlogfile} } proc ufs_check {host atom level line} { return [regexp {error|Unknown|EXITED|ATTENTION|abort|Bad} $line] } proc ufs_recover {host atom level} { set filename "$host" if { [string compare $atom "/"] == 0 } { append filename ".root" } else { regsub -all {/} $atom "." newatom append filename "$newatom" } append filename ".$level.burt" return [open "$filename" w] } proc ufs_schedule {line} { global logfilefd rshStatus foreach {host level type} $line {} if { $rshStatus(running) >= 10 } { vwait rshStatus(running) } scheduleHostWithRsh $host $level $type /s/std/bin/rsh -n incr rshStatus(scheduled) } proc ufs_size_command { host atom level } { return "/etc/dump ${level}S $atom" } proc ufs_size { host } { global logfilefd rshStatus puts $logfilefd "BURT: Sizing $host [burtTime]" if { $rshStatus(running) >= 15 } { vwait rshStatus(running) } incr rshStatus(scheduled) sizeHostWithRsh $host /s/std/bin/rsh -n }