aboutsummaryrefslogtreecommitdiff
path: root/sbin/spark-daemon.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/spark-daemon.sh')
-rwxr-xr-xsbin/spark-daemon.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/spark-daemon.sh b/sbin/spark-daemon.sh
index d8e0facb81..de762acc8f 100755
--- a/sbin/spark-daemon.sh
+++ b/sbin/spark-daemon.sh
@@ -129,7 +129,7 @@ run_command() {
if [ -f "$pid" ]; then
TARGET_ID="$(cat "$pid")"
- if [[ $(ps -p "$TARGET_ID" -o args=) =~ $command ]]; then
+ if [[ $(ps -p "$TARGET_ID" -o comm=) =~ "java" ]]; then
echo "$command running as process $TARGET_ID. Stop it first."
exit 1
fi
@@ -163,7 +163,7 @@ run_command() {
echo "$newpid" > "$pid"
sleep 2
# Check if the process has died; in that case we'll tail the log so the user can see
- if [[ ! $(ps -p "$newpid" -o args=) =~ $command ]]; then
+ if [[ ! $(ps -p "$newpid" -o comm=) =~ "java" ]]; then
echo "failed to launch $command:"
tail -2 "$log" | sed 's/^/ /'
echo "full log in $log"