sous-chefs / consul

Development repository for the consul cookbook
https://supermarket.chef.io/cookbooks/consul
Apache License 2.0
192 stars 244 forks source link

consul_service ignores program property #599

Closed evandam closed 2 years ago

evandam commented 2 years ago

:ghost: Brief Description

Setting the program in the consul_service resource does not change the value of ExecStart in the Systemd unit file.

:pancakes: Cookbook version

5.0.0

:woman_cook: Chef-Infra Version

16.17.4

:tophat: Platform details

Ubuntu 18.04 (test kitchen)

Steps To Reproduce

Sample cookbook:

consul_service 'service' do
  program '/my/custom/path'
  action %i(enable start)
end

Note service still points to /usr/local/bin/consul

# cat /etc/systemd/system/consul.service
[Unit]
Description=consul
Wants=network.target
After=network.target

[Service]
Environment="GOMAXPROCS=2" "PATH=/usr/local/bin:/usr/bin:/bin" "SHELL=/bin/false"
ExecStart=/usr/local/bin/consul agent -config-file=/etc/consul/chef.json -config-dir=/etc/consul/conf.d
ExecReload=/bin/kill -HUP $MAINPID
KillSignal=TERM
User=consul
WorkingDirectory=/var/lib/consul

[Install]
WantedBy=multi-user.target

:police_car: Expected behavior

ExecStart=/my/custom/path agent -config-file=/etc/consul/chef.json -config-dir=/etc/consul/conf.d

:heavy_plus_sign: Additional context

Worked prior to 5.0.0.

evandam commented 2 years ago

Fixed in #600 - thanks @ramereth!