Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit consul-template.service entered failed state, exit code=14 #83

Open
Zloy opened this issue Feb 19, 2018 · 0 comments
Open

Unit consul-template.service entered failed state, exit code=14 #83

Zloy opened this issue Feb 19, 2018 · 0 comments

Comments

@Zloy
Copy link

Zloy commented Feb 19, 2018

The cookbook runs successfully, but the service enters failed state:

$ sudo service consul-template status
Redirecting to /bin/systemctl status  consul-template.service
● consul-template.service - Consul Template Daemon
   Loaded: loaded (/etc/systemd/system/consul-template.service; enabled; vendor preset: disabled)
   Active: activating (auto-restart) (Result: exit-code) since Mon 2018-02-19 09:14:52 UTC; 35s ago
  Process: 26129 ExecStart=/usr/local/bin/consul-template -config /etc/consul-template.d (code=exited, status=14)
 Main PID: 26129 (code=exited, status=14)

In case I manually run the comand /usr/local/bin/consul-template -config /etc/consul-template.d or service consul-template restart it perfectly works.


OS Centos: 7.3.1611
The cookbook version: 0.12.0
Chef-client: 12.20.3
consul-template: 0.19.4

$ sudo cat /etc/systemd/system/consul-template.service
[Unit]
Description=Consul Template Daemon
Wants=basic.target
After=basic.target network.target

[Service]
User=consul-template
Group=consul-template
ExecStart=/usr/local/bin/consul-template -config /etc/consul-template.d
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
RestartSec=42s

[Install]
WantedBy=multi-user.target

$ sudo cat /etc/consul-template.d/default.json
{
}


$ sudo cat /etc/consul-template.d/haproxy

template {
  source = "/etc/haproxy/haproxy.cfg.ctmpl"
  destination = "/etc/haproxy/haproxy.cfg"

  command = "/bin/bash -c 'systemctl restart haproxy || true'"






}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant