Created
March 1, 2015 00:45
-
-
Save Squab/4cf8d8f14f510b9fd905 to your computer and use it in GitHub Desktop.
Get hostname in upstart script Ubuntu 14.04
This file contains 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
description "example hostname script" | |
author "Tim Simmons" | |
setuid bob | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
# retry if ended unexpectedly | |
respawn | |
# limit the retries to max 15 times with timeouts of 5 seconds | |
respawn limit 15 5 | |
# Time to wait between sending TERM and KILL signals | |
kill timeout 20 | |
script | |
HOSTNAME=$(hostname -s) | |
exec /path/to/app -n $HOSTNAME | |
end script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment