We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d47216 commit 6a6e7e1Copy full SHA for 6a6e7e1
integration-test/script/jboss_pid.sh
@@ -1,2 +1,19 @@
1
-#!/bin/bash
2
-pgrep -f 'Main|jboss-modules.jar' | tr -d '\n'
+#!/bin/sh
+
3
+TARGET_PATTERN='Main|jboss-modules.jar'
4
5
+for pid_dir in /proc/*; do
6
+ if [ -d "$pid_dir" ] && ! [ -z "$(echo "$pid_dir" | sed 's|/proc/||' | grep -E '^[0-9]+$')" ]; then
7
+ PID=$(echo "$pid_dir" | sed 's|/proc/||')
8
+ CMDLINE_FILE="$pid_dir/cmdline"
9
+ if [ -r "$CMDLINE_FILE" ]; then
10
+ FULL_CMD=$(sed 's/\x0/ /g' "$CMDLINE_FILE")
11
+ if [ -z "$FULL_CMD" ]; then
12
+ continue
13
+ fi
14
+ if echo "$FULL_CMD" | grep -E -q "$TARGET_PATTERN"; then
15
+ echo $PID
16
17
18
19
+done
0 commit comments