[Unit] Description=Register Hello World %i BindsTo=helloworld@%i.service After=helloworld@%i.service [Service] EnvironmentFile=/run/helloworld.env ExecStartPre=/usr/bin/etcdctl set /services/changed/helloworld 1 ExecStart=/usr/bin/bash -c 'while true; do [ "`etcdctl get /services/helloworld/${FLANNEL_IP}`" != "server ${FLANNEL_IP}:3000;" ] && etcdctl set /services/changed/helloworld 1; etcdctl set /services/helloworld/${FLANNEL_IP} \'server ${FLANNEL_IP}:3000;\' --ttl 60;sleep 45;done' ExecStop=/usr/bin/etcdctl rm /services/helloworld/helloworld@%i ExecStopPost=/usr/bin/etcdctl set /services/changed/helloworld 1 [X-Fleet] MachineOf=helloworld@%i.service