No way to notifies :restart, "service[influxdb]" ?
Closed this issue · 8 comments
Unless I'm missing something here, I don't see a sane way to notify the influxdb service to restart on configuration change.
Is this not possible with chef-influxdb?
As a dirty hack, I implemented md5 hash checking myself in a ruby block on a separate recipe. This ruby block notifies my service resource.
If anyone knows of a "proper way" to notify the service to restart, let me know.
We could certainly add that code or similar to this cookbook. I think this would be a pretty basic PR, actually, similar to the stanzas here:
action :restart do
influxdb_service(:restart)
end
We could add a another private method to do the hash check you implemented as well. Unfortunately I'm not familiar enough with the software to say whether a simpler solution exists, or a reload or something.
This is one of the weird couplings of this cookbook (it was the first time I had attempted this pattern of making the main installation a resource). I regret it in hindsight, and wish I had made an influxdb_service
provider as well, but hindsight is 20/20. Anyway, I think we can still make it work without too much fuss.
Hi,
I think of adding a "notifies" method would fix the problem.
https://github.com/chrisduong/chef-influxdb/blob/service-restart-on-change/recipes/default.rb#L64-L67
@chrisduong does the code change you did remediate the restart issue?
@bdangit just use the latest master in this repo, it will restart InfluxDB when config changed. Somebody fixed it :)
cool. that's what I thought. if anyone who has config restarts issue, can try the 4.0.0 release and comment back, that would help to see if we need to fix it still.
closing. please re-open if this is not the case.