Skip to content

Instantly share code, notes, and snippets.

@dictvm
Created August 10, 2017 15:43
Show Gist options
  • Save dictvm/966352f93b770b2bd3545f0a0f787a1b to your computer and use it in GitHub Desktop.
Save dictvm/966352f93b770b2bd3545f0a0f787a1b to your computer and use it in GitHub Desktop.
[Unit]
Description=Consul service discovery agent
Requires=network-online.target
After=network.target
[Service]
User=consul
Group=consul
Restart=on-failure
Environment=GOMAXPROCS=2
ExecStartPre=/usr/local/bin/consul configtest -config-dir=/etc/consul.d
ExecStart=/usr/local/bin/consul agent -config-dir=/etc/consul.d -data-dir /var/lib/consul -retry-join 'provider=aws tag_key=App tag_value=consul' -ui -bind $IP -raft-protocol=3
ExecReload=/bin/kill -s HUP $MAINPID
KillSignal=SIGINT
TimeoutStopSec=5
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment