Follow up to "Adapt gerrit.sh script to work on Alpine Linux"
Issue: Older centos linux distros don't return all pids when simple 'ps' is called and as a result gerrit's PID is not listed and cannot be found by the following 'grep'. It result in the situation when gerrit.sh is not properly handling start/stop commands. Solution: Add 'ax' parameter so that 'ps' returns all pids. It was successfully tested with centos and alpine 3.9.4 e.g.: bash-4.4# echo "$PID" 62 bash-4.4# ps ax -o pid | grep -w $PID 62 Change-Id: I43596f0449f0d357dc640e582381210b61e4ca2d Signed-off-by: Jacek Centkowski <jcentkowski@collab.net>
This commit is contained in:
parent
d8a432a79e
commit
292815cf05
@ -63,7 +63,7 @@ test $# -gt 0 || usage
|
||||
running() {
|
||||
test -f $1 || return 1
|
||||
PID=`cat $1`
|
||||
ps -o pid | grep -w $PID >/dev/null 2>/dev/null || return 1
|
||||
ps ax -o pid | grep -w $PID >/dev/null 2>/dev/null || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user