Skip to content

Instantly share code, notes, and snippets.

@umardx
Last active June 8, 2017 07:04
Show Gist options
  • Select an option

  • Save umardx/5dfd8e706ed1f5ad96f5a708b754bd16 to your computer and use it in GitHub Desktop.

Select an option

Save umardx/5dfd8e706ed1f5ad96f5a708b754bd16 to your computer and use it in GitHub Desktop.
Systemd for consul: /etc/systemd/system/consul.service
[Unit]
Description=Consul Agent
Requires=network-online.target
After=network-online.target
[Service]
Restart=on-failure
PIDFile=/run/consul.pid
ExecStartPre=[ -f "/run/consul.pid" ] && /usr/bin/rm -f /run/consul.pid
ExecStartPre=/usr/local/bin/consul configtest -config-dir=/etc/consul.d/server
ExecStart=/usr/local/bin/consul agent -config-dir=/etc/consul.d/server -pid-file=/run/consul.pid
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=SIGINT
TimeoutStopSec=10
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment