Last active
March 2, 2019 20:11
-
-
Save yildirima/b6927c96bc5a5532992001395777c89c to your computer and use it in GitHub Desktop.
Consul Service File
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
#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 |
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
#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