Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

logstash server getting restarted on every chef run #438

Open
johnnydtan opened this issue Dec 11, 2015 · 1 comment
Open

logstash server getting restarted on every chef run #438

johnnydtan opened this issue Dec 11, 2015 · 1 comment

Comments

@johnnydtan
Copy link

We've noticed that logstash server is getting restarted on every chef run. It seems to be due to this:

[2015-12-11T20:45:16+00:00] INFO: execute[bin/plugin install logstash-output-influxdb] sending restart action to logstash_service[server] (delayed)

That seems to originate from this plugin provider code:

  case @install_type
  when 'native'
    ex = execute "bin/plugin install #{ls_name}" do
      command "bin/plugin install #{ls_name}"
      user    ls_user
      group   ls_group
      cwd     ls_instance_dir
      notifies :restart, "logstash_service[#{ls_instance}]"
      # this is a temp workaround to make the plugin command idempotent.
      not_if { ::File.exist?("#{ls_instance_dir}/#{ls_install_check}") }
    end
    new_resource.updated_by_last_action(ex.updated_by_last_action?)

Which suggests that the file is not being created in the right place by execution of that code. The plugin seems to exist, though:

[~]# /opt/logstash/server/bin/plugin list | grep influx
logstash-output-influxdb

Where is "#{ls_instance_dir}/#{ls_install_check}"? Wherever that is, chef is not finding what it needs to find there.

/cc @annisele

@johnnydtan
Copy link
Author

Actually this all stems from attempting to install a plugin in the server.rb recipe, why is this even necessary in the community cookbook? https://github.com/lusis/chef-logstash/blob/master/recipes/server.rb#L30-L34

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

No branches or pull requests

1 participant