meer en beter

This commit is contained in:
Ward Wouts 2009-01-30 14:59:04 +00:00
parent 2269a30107
commit 84776cb511

View file

@ -153,7 +153,18 @@ def master
file.puts "0" file.puts "0"
} }
# echo 0 >"${basedir}/$runningfile"
#
# while sleep $waittime; do
# if [ $(cat "${basedir}/${runningfile}") -lt $maxproc ]; then
# # via ls omdat anders de globbing klote is
# jl=$(ls ${basedir}/jobs/)
# if [ -n "$jl" ]; then
# ${pbcommand} process &
# fi
# readconfig
# fi
# done
end end
def deljob def deljob
@ -209,15 +220,35 @@ def unfail
end end
def changeprio def changeprio
puts "unimplemented"
end end
def runprocessor def runprocessor
# incrementrunning
# sleep 1
# runjob=$(getjob)
# if [ -n "${runjob}" ]; then
# echo "Starting job: ${runjob}"
# owd=$(pwd)
# cd "${basedir}/processors/${runjob}"
# if "${basedir}/processors/${runjob}/job" 2>&1 > "${basedir}/processors/${runjob}/output" ;then
# finishjob ${runjob}
# echo "Finished job: ${runjob}"
# else
# failjob ${runjob}
# echo "Failed job: ${runjob}"
# fi
# cd $owd
# fi
# decrementrunning
end end
def stop def stop
puts "unimplemented"
end end
def stopall def stopall
puts "unimplemented"
end end
pbcommand = $0 pbcommand = $0
@ -232,16 +263,16 @@ case command
when "addfile", "af" then addjobfromfile when "addfile", "af" then addjobfromfile
when "createconfig" then createconfig when "createconfig" then createconfig
when "run" then master when "run" then master
when "del" then deljob "$*" when "del" then deljob
when "help" then usage when "help" then usage
when "-h" then usage when "-h" then usage
when "park" then parkjobs when "park" then parkjobs
when "unpark" then unparkjobs when "unpark" then unparkjobs
when "retry" then unfail "$*" when "retry" then unfail
when "prio" then changeprio "$*" when "prio" then changeprio
when "process" then runprocessor "$*" when "process" then runprocessor
when "status", "st" then status when "status", "st" then status
when "stop" then stop "$*" when "stop" then stop
when "stopall" then stopall when "stopall" then stopall
else usage else usage
end end