Skip to content

Instantly share code, notes, and snippets.

@mdasilva
Created December 14, 2017 22:47
Show Gist options
  • Save mdasilva/9896a8a9070b48236146077829a8eea7 to your computer and use it in GitHub Desktop.
Save mdasilva/9896a8a9070b48236146077829a8eea7 to your computer and use it in GitHub Desktop.
[Unit]
Description=consul server
Requires=network-online.target
After=network-online.target
[Service]
User=consul
Group=consul
Restart=on-failure
PIDFile=/run/consul/consul.pid
Environment=GOMAXPROCS=2
ExecStartPre=[ -f "/run/consul/consul.pid" ] && /bin/rm -f /run/consul/consul.pid
#ExecStartPre=/usr/local/bin/consul configtest -config-dir=/etc/consul.d/server
ExecStart=/usr/local/bin/consul agent -pid-file=/run/consul/consul.pid -config-dir=/etc/consul.d/server
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