Skip to content

Commit

Permalink
tgtd.service: Wait for tgtd to be ready
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JohnAZoidberg committed Jul 29, 2019
1 parent 6595edd commit e68aeee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/tgtd.service
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit e68aeee

Please sign in to comment.