FYI, here is our uggly-but-working trick
nohup wget --retry-connrefused http://127.0.0.1:9200/_template &&
curl -H "Content-Type: application/json" -XPUT
--data @/usr/share/elasticsearch/config/templates/my-template_default.json
http://127.0.0.1:9200/_template/my-template-default &
//then we call the blocking entrypoint