kolla/docker/base/healthcheck_socket

11 lines
227 B
Bash
Executable File

#!/bin/bash
process=$1
socket=$2
# lsof truncate command name to 15 characters and this behaviour
# cannot be disabled
if [ ${#process} -gt 15 ] ; then
process=${process:0:15}
fi
lsof -Fc -Ua $socket | grep -q "c$process"