aboutsummaryrefslogtreecommitdiff
path: root/docker/base/healthcheck_socket
diff options
context:
space:
mode:
authorMichal Nasiadka <mnasiadka@gmail.com>2019-08-13 07:55:58 +0000
committerMichal Nasiadka <mnasiadka@gmail.com>2019-12-09 12:57:10 +0000
commit79851d7929027050d0d1e76aaa28e83c141dcc55 (patch)
tree813e808a5d44aae76777dd4d2b262f9ebda1b524 /docker/base/healthcheck_socket
parentf1e236522525361b8db1c05bee2b53b1c2a4dc5e (diff)
downloadkolla-79851d7929027050d0d1e76aaa28e83c141dcc55.tar.gz
kolla-79851d7929027050d0d1e76aaa28e83c141dcc55.zip
Build images with healthcheck scripts for core services
blueprint container-health-check Now docker supports healthcheck directive[0] in Dockerfile, which is helpful for checking container aliveness. Base for this patch were healthcheck scripts from tripleo[1]. [0] https://docs.docker.com/engine/reference/builder/#healthcheck [1] https://github.com/openstack/tripleo-common/tree/master/healthcheck Change-Id: Ifc32713cd4d6b45c74855c0ebf5bb65784701d44
Diffstat (limited to 'docker/base/healthcheck_socket')
-rwxr-xr-xdocker/base/healthcheck_socket10
1 files changed, 10 insertions, 0 deletions
diff --git a/docker/base/healthcheck_socket b/docker/base/healthcheck_socket
new file mode 100755
index 000000000..cd65bae69
--- /dev/null
+++ b/docker/base/healthcheck_socket
@@ -0,0 +1,10 @@
+#!/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"