Changeset 26


Ignore:
Timestamp:
Jan 19, 2017, 12:01:07 PM (7 years ago)
Author:
gegorbet
Message:

various minor fixes/mods to gridctl

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/cleanup.php

    r25 r26  
    195195   $fn_tarfile = "analysis-results.tar";
    196196   $num_try    = 0;
    197 $len1 = strlen( $fn_tarfile );
    198 write_log( "$me: fn_tarfile=$fn_tarfile  len(tar)=$len1" );
     197write_log( "$me: fn_tarfile=$fn_tarfile" );
    199198   while ( ! file_exists( $fn_tarfile ) && $num_try < 3 )
    200199   {
     
    218217else                          write_log( "$me: NOT FOUND: $fn_tarfile" );
    219218
     219   $stderr   = '';
     220   $stdout   = '';
     221   $tarfile  = '';
    220222   if ( file_exists( $fn_stderr  ) ) $stderr   = file_get_contents( $fn_stderr  );
    221223   if ( file_exists( $fn_stdout  ) ) $stdout   = file_get_contents( $fn_stdout  );
    222224   if ( file_exists( $fn_tarfile ) ) $tarfile  = file_get_contents( $fn_tarfile );
     225   // If stdout,stderr have no content, retry after delay
     226   if ( strlen( $stdout ) == 0  ||  strlen( $stderr ) == 0 )
     227   {
     228      sleep( 20 );
     229      if ( file_exists( $fn_stderr  ) )
     230         $stderr   = file_get_contents( $fn_stderr  );
     231      if ( file_exists( $fn_stdout  ) )
     232         $stdout   = file_get_contents( $fn_stdout  );
     233   }
     234
     235write_log( "$me:  length contents stderr,stdout,tarfile -- "
     236 . strlen($stderr) . "," . strlen($stdout) . "," . strlen($tarfile) );
    223237
    224238   if ( $cluster == 'alamo'  || $cluster == 'alamo-local' )
  • trunk/cluster_status.php

    r25 r26  
    44include "$us3bin/listen-config.php";
    55
    6 if ( ! preg_match( "/localhost/", $dbhost ) )
     6if ( ! preg_match( "/_local/", $class_dir ) )
    77{
    88   $xml  = get_data();
     
    1818foreach ( $data as $item )
    1919{
    20    update( $item[ 'cluster' ], $item[ 'queued' ], $item[ 'status' ], $item[ 'running' ] );
     20   if ( ! preg_match( "/error/", $item[ 'running' ] ) )
     21      update( $item[ 'cluster' ], $item[ 'queued' ], $item[ 'status' ], $item[ 'running' ] );
    2122}
    2223
     
    170171   global $dbhost;
    171172   global $org_domain;
    172 
    173    if ( preg_match( "/localhost/", $dbhost ) )
     173   global $class_dir;
     174
     175   if ( preg_match( "/_local/", $class_dir ) )
    174176   {
    175177      if ( preg_match( "/attlocal/", $org_domain ) )
  • trunk/gridctl.php

    r25 r26  
    181181      case "FINISHED":
    182182      case "DONE":
    183          if ( is_aira_job( $gfacID ) )
     183         if ( ! is_aira_job( $gfacID ) )
    184184         {
    185185            complete();
     
    464464   global $us3_db;
    465465   global $loghdr;
     466   global $class_dir;
    466467
    467468   // Double check that the gfacID exists
     
    10491050   global $self;
    10501051   global $loghdr;
     1052   global $class_dir;
    10511053//echo "a_st: st_in$status_in : $gfacID\n";
    10521054   //$status_gw = standard_status( $status_in );
  • trunk/listen-config.php.template

    r21 r26  
    1313$class_dir_p = '/srv/www/htdocs/common/class/';        // Class dir for production
    1414$class_dir_d = '/srv/www/htdocs/common/class_devel/';  // Class dir for development
     15$class_dir_l = '/srv/www/htdocs/common/class_local/';  // Class dir for development
    1516$class_dir   = $class_dir_p;                           // Class dir default
    1617
  • trunk/manage-us3-pipe.php

    r25 r26  
    6666   if ( ! mysql_select_db( $db, $resource ) )
    6767   {
    68      write_log( "$self: Could not select DB $db" . mysql_error( $resource ) );
     68     write_log( "$self: Could not select DB $db " . mysql_error( $resource ) );
    6969     write_log( "$self process(): original msg - $msg" );
    7070     return;
     
    174174   if ( ! mysql_select_db( $db, $resource ) )
    175175   {
    176      write_log( "$self: Could not select DB $db" . mysql_error( $resource ) );
     176     write_log( "$self: Could not select DB $db " . mysql_error( $resource ) );
    177177     return;
    178178   }
     
    245245  if ( ! mysql_select_db( $gDB, $gLink ) )
    246246  {
    247     write_log( "$self: Could not select DB $gDB" . mysql_error( $gLink ) );
     247    write_log( "$self: Could not select DB $gDB " . mysql_error( $gLink ) );
    248248    return;
    249249  }
     
    356356   if ( ! mysql_select_db( $gDB, $gLink ) )
    357357   {
    358       write_log( "$self: Could not select DB $gDB" . mysql_error( $gLink ) );
     358      write_log( "$self: Could not select DB $gDB " . mysql_error( $gLink ) );
    359359      return;
    360360   }
  • trunk/update_notice.php

    r25 r26  
    1010
    1111$s_cmd1 = "/usr/bin/svn info svn:$s_url1|grep Revision|cut -d ' ' -f2";
    12 $s_cmd2 = "/usr/bin/svn info svn:$s_url1|grep Revision|cut -d ' ' -f2";
     12$s_cmd2 = "/usr/bin/svn info svn:$s_url2|grep Revision|cut -d ' ' -f2";
    1313
    1414$s_rev1 = exec( $s_cmd1 );
Note: See TracChangeset for help on using the changeset viewer.