Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Consul Service File
#cat /usr/lib/systemd/system/consulv1-bootstrap.service
[Unit]
Description=Consul Agent (BootStrap)
After=network.target
[Service]
Restart=on-failure
User=appuser
Group=appgroup
Environment=HOME=/appdata/consulv1
EnvironmentFile=/appdata/consulv1/env
WorkingDirectory=/appdata/consulv1
ExecStartPre=/bin/echo IP=`/bin/hostname --ip-address` > /appdata/consulv1/env
ExecStart=/appdata/consulv1/consul agent -ui -config-dir=/appdata/consulv1/config -client $IP -bind $IP
ExecReload=/bin/kill -USR1 $MAINPID
PermissionsStartOnly=true
[Install]
WantedBy=multi-user.target
#cat /usr/lib/systemd/system/consulv1-server.service
[Unit]
Description=Consul Agent (Server)
After=network.target
[Service]
Restart=on-failure
User=appuser
Group=appgroup
Environment=HOME=/appdata/consulv1
EnvironmentFile=/appdata/consulv1/env
WorkingDirectory=/appdata/consulv1
ExecStartPre=/bin/echo IP=`/bin/hostname --ip-address` > /appdata/consulv1/env
ExecStart=/appdata/consulv1/consul agent -ui -config-dir=/appdata/consulv1/config -client $IP -bind $IP
ExecReload=/bin/kill -USR1 $MAINPID
PermissionsStartOnly=true
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.