- Timestamp:
- Jun 1, 2026, 4:53:16 PM (7 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-pstamp-20260421/pstamp/scripts/pstamp_server_status
r42983 r43048 13 13 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt ); 14 14 use Pod::Usage qw( pod2usage ); 15 15 use Scalar::Util qw(looks_like_number); 16 16 17 17 my ($rundir, $workdir, $verbose, $save_temps); … … 71 71 my $serverRunning = 0; 72 72 my $command = "$pantasks_client < $pantasks_script"; 73 my ( $success, $error_ code, $full_buf, $stdout_buf, $stderr_buf ) =73 my ( $success, $error_msg, $full_buf, $stdout_buf, $stderr_buf ) = 74 74 run(command => $command, verbose => $verbose); 75 my $error_code = &parse_error_message ($success, $error_msg, $command); 75 76 if ($success) { 76 77 $serverRunning = 1; 77 78 } else { 78 $error_code = ( ($error_code >> 8)or 1);79 $error_code = ($error_code or 1); 79 80 if ($error_code == 12 || $error_code == 13) { 80 81 print "Postage Stamp Server is not running\n<br>"; … … 205 206 206 207 exit 0; 208 209 # if the program exited normally, the exit value is returned 210 # if the program exited with a signal (abort, crash, etc), PS_EXIT_PROG_ERROR (4) is returned 211 # if the program failed to run, -PS_EXIT_PROG_ERROR (-4) is returned 212 sub parse_error_message { 213 my $success = shift; 214 my $error_msg = shift; 215 my $command = shift; 216 217 if ($success) { return 0; } 218 219 print "raw error_msg: $error_msg\n"; 220 print "full command: $command\n"; 221 222 if (&looks_like_number($error_msg)) { return (($error_msg >> 8) or ($PS_EXIT_PROG_ERROR)); } 223 224 # which of these match? 225 my ($error_code) = $error_msg =~ m/exited with value (\d+)/; 226 if (defined $error_code) { return $error_code; } 227 228 ($error_code) = $error_msg =~ m/died with signal (\d+)/; 229 # if (defined $error_code) { return (128 + $error_code); } 230 if (defined $error_code) { return ($PS_EXIT_PROG_ERROR); } 231 232 # probably failed to execute: 233 return (-1*$PS_EXIT_PROG_ERROR); 234 }
Note:
See TracChangeset
for help on using the changeset viewer.
