From e68aeee7716ea6606e9078959ac1a99883b5ff4b Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Mon, 29 Jul 2019 20:56:10 +0200 Subject: [PATCH] tgtd.service: Wait for tgtd to be ready If we don't wait, it fails with: tgtadm: failed to send request hdr to tgt daemon, Transport endpoint is not connected It's not a pretty solution but CentOS and Fedora do the same workaround. --- scripts/tgtd.service | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/tgtd.service b/scripts/tgtd.service index 9884201f..63b346b1 100644 --- a/scripts/tgtd.service +++ b/scripts/tgtd.service @@ -9,6 +9,9 @@ ConditionPathExists=/etc/tgt/targets.conf Environment=TGTD_CONFIG=/etc/tgt/targets.conf ExecStart=/usr/sbin/tgtd --foreground +# Wait for tgtd to be ready +# See https://bugzilla.redhat.com/show_bug.cgi?id=848942 +ExecStartPost=/usr/sbin/sleep 5 ExecStartPost=/usr/sbin/tgtadm --op update --mode sys --name State -value offline ExecStartPost=/usr/sbin/tgtadm --op update --mode sys --name State -value ready ExecStartPost=/usr/sbin/tgt-admin --verbose --execute --conf ${TGTD_CONFIG}