IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 40139


Ignore:
Timestamp:
Sep 18, 2017, 8:48:44 AM (9 years ago)
Author:
eugene
Message:

add option to block stop.block.restart; stop pantasks before shutting down

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-20170121/tools/check_system.sh

    r40100 r40139  
    262262endif
    263263
     264if ("$1" == "restart.block") then
     265  touch ~/.restart.block
     266  exit 0
     267endif
     268
     269if ("$1" == "restart.clear") then
     270  rm -f ~/.restart.block
     271  exit 0
     272endif
     273
     274if ("$1" == "restart.check") then
     275  if ( -f ~/.restart.block ) then
     276    echo "check_system.sh stop.block.restart is currently BLOCKED"
     277  else
     278    echo "check_system.sh stop.block.restart is currently NOT BLOCKED"
     279  endif
     280  exit 0
     281endif
     282
    264283if ("$1" == "stop.block.restart") then
    265284
    266   # set all controllers to reap first, then block waiting for clear task list:
     285  if ( -f ~/.restart.block ) then
     286    echo "check_system.sh stop.block.restart is currently BLOCKED"
     287    exit 1
     288  endif
     289
     290  # set all pantasks to stop
    267291  foreach dir ($dirs)
    268292    echo "setting $dir to 'reap'"
     
    270294  end
    271295
     296  # set all controllers to reap, then block waiting for clear task list:
     297  foreach dir ($dirs)
     298    echo "setting $dir to 'reap'"
     299    echo "controller run reap" | pantasks_client -c $dir/ptolemy.rc >& /dev/null
     300  end
     301
    272302  set tmpfile = `mktemp /tmp/pantasks.XXXXXX`
    273303
     
    276306    echo "waiting for jobs to clear on $dir"
    277307
     308    # wait for at most 15 minutes (the stamp jobs may take 750 seconds to complete)
    278309    set Njobs = 1
    279310    set Nloop = 0
    280     while ($Nloop < 30)
     311    while ($Nloop < 90)
    281312      echo "control status -nohost -state busy" | pantasks_client -c $dir/ptolemy.rc >& $tmpfile
    282313      set Njobs = `awk '($3 == "BUSY"){print $0}' $tmpfile | wc -l`
Note: See TracChangeset for help on using the changeset viewer.