diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-09-14 17:21:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-14 17:21:20 +0200 |
commit | d3e8604a5ac5d0573e1406dad192954efe4d8886 (patch) | |
tree | 9911a8db47316ff3f392a2c89b3fab0e7f684157 | |
parent | d0abedf6f36b649f4d2fc58579ae5cd2944447d8 (diff) | |
parent | 576d1c1e55b53a84bf59141563d065b85b70aab8 (diff) |
Merge pull request #24051 from vespa-engine/arnej/pstack-without-perl
rewrite simple perl script in /bin/sh
-rwxr-xr-x | storage/src/tests/pstack_testrunner | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/storage/src/tests/pstack_testrunner b/storage/src/tests/pstack_testrunner index 151aaec7e1a..4d4d5105d5a 100755 --- a/storage/src/tests/pstack_testrunner +++ b/storage/src/tests/pstack_testrunner @@ -1,15 +1,9 @@ -#!/usr/bin/perl -w +#!/bin/sh # Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -use strict; - -my @pids = `ps auxww | grep "./testrunner" | grep -v grep`; -foreach (@pids) { - s/^\S+\s+(\d+)\s+.*$/$1/; - chomp; -} - -foreach my $pid (@pids) { - my $cmd = "pstack $pid"; - system($cmd) == 0 or die "Failed to run '$cmd'"; -} +ps auxww | grep "./testrunner" | grep -v grep | while read username pid restofline; do + if pstack $pid; then :; else + echo "Failed to run 'pstack $pid'" + exit 1 + fi +done |