Remove now useless sudo call for port check
Back then, the "sudo" was needed because healthchecks were running as root, using a paunch created systemd unit/timer calling "podman exec --user root". Now that we're using native healthchecks, we can get rid of the sudo call, since it's already using as the intended user. Closes-Bug: #1940068 Change-Id: I7eaabc91005952aa956456944c46224f08f4c7f8
This commit is contained in:
parent
1a6d0d8013
commit
36a7a4d093
|
@ -51,7 +51,6 @@ healthcheck_port () {
|
||||||
|
|
||||||
shift 1
|
shift 1
|
||||||
ports=""
|
ports=""
|
||||||
puser=$(get_user_from_process $process)
|
|
||||||
# First convert port to hex value. We need to 0-pad it in order to get the
|
# First convert port to hex value. We need to 0-pad it in order to get the
|
||||||
# right format (4 chars).
|
# right format (4 chars).
|
||||||
for p in $@; do
|
for p in $@; do
|
||||||
|
@ -76,7 +75,7 @@ healthcheck_port () {
|
||||||
match=0
|
match=0
|
||||||
for pid in $(pgrep -f $process); do
|
for pid in $(pgrep -f $process); do
|
||||||
# Here, we check if a socket is actually associated to the process PIDs
|
# Here, we check if a socket is actually associated to the process PIDs
|
||||||
match=$(( $match+$(sudo -u $puser find /proc/$pid/fd/ -ilname "socket*" -printf "%l\n" 2>/dev/null | grep -c -E "(${sockets})") ))
|
match=$(( $match+$(find /proc/$pid/fd/ -ilname "socket*" -printf "%l\n" 2>/dev/null | grep -c -E "(${sockets})") ))
|
||||||
test $match -gt 0 && exit 0 # exit as soon as we get a match
|
test $match -gt 0 && exit 0 # exit as soon as we get a match
|
||||||
done
|
done
|
||||||
exit 1 # no early exit, meaning failure.
|
exit 1 # no early exit, meaning failure.
|
||||||
|
|
Loading…
Reference in New Issue