consul.serviceファイルの ExecPre=
行を変更する。
この行を
ExecStartPre=[ -f "/run/consul/consul.pid" ] && /usr/bin/rm -f /run/consul/consul.pid
こう変更する。
ExecStartPre=/bin/echo "[ -f /run/consul/consul.pid ] && /bin/rm -f /run/consul/consul.pid" | /bin/sh -s
consul.serviceファイルの ExecPre=
行を変更する。
この行を
ExecStartPre=[ -f "/run/consul/consul.pid" ] && /usr/bin/rm -f /run/consul/consul.pid
こう変更する。
ExecStartPre=/bin/echo "[ -f /run/consul/consul.pid ] && /bin/rm -f /run/consul/consul.pid" | /bin/sh -s
[Unit] | |
Description=consul agent | |
Requires=network-online.target | |
After=network-online.target | |
[Service] | |
User=consul | |
Group=consul | |
PIDFile=/run/consul/consul.pid | |
Restart=on-failure | |
Environment=GOMAXPROCS=2 | |
ExecStartPre=/bin/echo "[ -f /run/consul/consul.pid ] && /bin/rm -f /run/consul/consul.pid" | /bin/sh -s | |
ExecStartPre=/usr/local/bin/consul validate /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 |