From bb51db3e0adddd7cf1830a365a31781e861c32c7 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 17 Oct 2022 18:18:58 +0200 Subject: [PATCH] redis-client: add service to wait redis --- seed/redis-client/dictionaries/23_redis.xml | 2 +- seed/redis-client/manual/image/preinstall/redis.sh | 1 + seed/redis-client/templates/redis-client.service | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 seed/redis-client/manual/image/preinstall/redis.sh create mode 100644 seed/redis-client/templates/redis-client.service diff --git a/seed/redis-client/dictionaries/23_redis.xml b/seed/redis-client/dictionaries/23_redis.xml index 0d5b1acb..c3ab018a 100644 --- a/seed/redis-client/dictionaries/23_redis.xml +++ b/seed/redis-client/dictionaries/23_redis.xml @@ -1,7 +1,7 @@ - + /etc/pki/ca-trust/source/anchors/ca_Redis.crt /etc/pki/tls/certs/redis.crt /etc/pki/tls/private/redis.key diff --git a/seed/redis-client/manual/image/preinstall/redis.sh b/seed/redis-client/manual/image/preinstall/redis.sh new file mode 100644 index 00000000..71dc98d7 --- /dev/null +++ b/seed/redis-client/manual/image/preinstall/redis.sh @@ -0,0 +1 @@ +PKG="$PKG redis" diff --git a/seed/redis-client/templates/redis-client.service b/seed/redis-client/templates/redis-client.service new file mode 100644 index 00000000..a15f632b --- /dev/null +++ b/seed/redis-client/templates/redis-client.service @@ -0,0 +1,8 @@ +[Unit] +After=network-online.target +Before=risotto.target + +[Service] +Type=oneshot +User=%%redis_client_key_owner +ExecStart=/usr/bin/timeout 90 bash -c 'while ! /usr/bin/redis-cli --tls -a %%redis_client_password --cacert /etc/pki/ca-trust/source/anchors/ca_Redis.crt --cert /etc/pki/tls/certs/redis.crt --key /etc/pki/tls/private/redis.key -h %%redis_client_server_domainname -p 6380 PING; do sleep 1; done'