Add healthcheck script for memcached

This patch adds script for docker health check of memcached service.
The script checks the service using socat.

Change-Id: Icae9acdd6b10b341c1b189872b7ef864d7ea0806
Depends-On: Ibda77a8d041d894f5efac6578e52b11651bca97f
This commit is contained in:
Martin Mágr 2018-02-13 17:54:46 +01:00
parent 1550e16d6e
commit 4386128f37
1 changed files with 5 additions and 0 deletions

5
healthcheck/memcached Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
listen_addr=$(awk 'match($0, /-l +([0-9a-fA-F\.\:]+) /, a) {print a[1]}' /etc/sysconfig/memcached)
echo "stats" | socat - TCP:$listen_addr:11211
exit