Created
July 25, 2014 15:04
-
-
Save charlesmarshall/22894dd746bb4cf768e5 to your computer and use it in GitHub Desktop.
heartbeat for the simple website service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Unit] | |
| Description=heartbeat for website | |
| BindTo=website.service | |
| [X-Fleet] | |
| X-ConditionMachineOf=website.service | |
| [Service] | |
| EnvironmentFile=$pathToBashUtilitiesFile | |
| Environment="envFile=$pathToBashUtilitiesFile" | |
| Environment="containerName=website$counter" | |
| Environment="sleepTime=20" | |
| Environment="timeout=40" | |
| Environment="serviceLocation=$(getServiceIPAndPort ${containerName} 800)" | |
| ExecStart=/usr/bin/bash -l -c "source ${env_file} ; while true ; do sleep ${sleepTime} ; etcdctl set /services/website:$counter ${serviceLocation} --ttl ${timeout} ; done ;" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment