Skip to content

Instantly share code, notes, and snippets.

@WangWenchao
Forked from Manc/consul.service
Created August 15, 2018 02:40
Show Gist options
  • Select an option

  • Save WangWenchao/b76f3e3938483ac99e72eb373f8e5527 to your computer and use it in GitHub Desktop.

Select an option

Save WangWenchao/b76f3e3938483ac99e72eb373f8e5527 to your computer and use it in GitHub Desktop.

Revisions

  1. @Manc Manc revised this gist Jan 9, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion consul.service
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ Group=consul
    PIDFile=/run/consul/consul.pid
    Restart=on-failure
    Environment=GOMAXPROCS=2
    ExecStartPre=/usr/bin/rm -f /run/consul/consul.pid
    ExecStartPre=[ -f "/run/consul/consul.pid" ] && /usr/bin/rm -f /run/consul/consul.pid
    ExecStartPre=/usr/local/bin/consul configtest -config-dir=/etc/consul.d
    ExecStart=/usr/local/bin/consul agent $OPTIONS -pid-file=/run/consul/consul.pid -config-dir=/etc/consul.d
    ExecReload=/bin/kill -s HUP $MAINPID
  2. @Manc Manc revised this gist Jan 9, 2016. 1 changed file with 11 additions and 6 deletions.
    17 changes: 11 additions & 6 deletions consul.service
    Original file line number Diff line number Diff line change
    @@ -1,15 +1,20 @@
    [Unit]
    Description=consul agent
    Description=Consul service discovery agent
    Requires=network-online.target
    After=network-online.target
    After=network.target

    [Service]
    EnvironmentFile=-/etc/sysconfig/consul
    Environment=GOMAXPROCS=2
    User=consul
    Group=consul
    PIDFile=/run/consul/consul.pid
    Restart=on-failure
    ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d
    ExecReload=/bin/kill -HUP $MAINPID
    Environment=GOMAXPROCS=2
    ExecStartPre=/usr/bin/rm -f /run/consul/consul.pid
    ExecStartPre=/usr/local/bin/consul configtest -config-dir=/etc/consul.d
    ExecStart=/usr/local/bin/consul agent $OPTIONS -pid-file=/run/consul/consul.pid -config-dir=/etc/consul.d
    ExecReload=/bin/kill -s HUP $MAINPID
    KillSignal=SIGINT
    TimeoutStopSec=5

    [Install]
    WantedBy=multi-user.target
  3. @yunano yunano created this gist May 1, 2015.
    15 changes: 15 additions & 0 deletions consul.service
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    [Unit]
    Description=consul agent
    Requires=network-online.target
    After=network-online.target

    [Service]
    EnvironmentFile=-/etc/sysconfig/consul
    Environment=GOMAXPROCS=2
    Restart=on-failure
    ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d
    ExecReload=/bin/kill -HUP $MAINPID
    KillSignal=SIGINT

    [Install]
    WantedBy=multi-user.target