pythian / opsviz

26 stars 24 forks source link

foxycoder chef-logstash dependency doesn't work on centos because of upstart #40

Open dtest opened 9 years ago

dtest commented 9 years ago

The current logstash cookbook that we rely on in bb_external is https://github.com/foxycoder/chef-logstash

The readme claims that it should work in other platforms but it only has been tested in ubuntu/debian systems.

The problem is the startup script relies on 'upstart', which as far as I know is Ubuntu only (without perhaps depending on the upstart cookbook: http://upstart.ubuntu.com/cookbook/#id416

I'm not sure we should be requiring upstart jobs, but if we don't find a different provider, we should at least fork the foxycoder repo with any fixes to allow init.d script. Or systemd as RHEL7 and Ubuntu seem to be going that route: http://www.markshuttleworth.com/archives/1316

dtest commented 9 years ago

Btw, the error message I get with the startup script is:

==> mha_master: Error executing action `restart` on resource 'service[logstash]'
==> mha_master: ================================================================================
==> mha_master:
==> mha_master: Mixlib::ShellOut::ShellCommandFailed
==> mha_master: ------------------------------------
==> mha_master: Expected process to exit with [0], but received '1'
==> mha_master: ---- Begin output of /sbin/start logstash ----
==> mha_master: STDOUT:
==> mha_master: STDERR: start: Unknown job: logstash
==> mha_master: ---- End output of /sbin/start logstash ----
==> mha_master: Ran /sbin/start logstash returned 1
==> mha_master:
==> mha_master: Resource Declaration:
==> mha_master: ---------------------
==> mha_master: # In /tmp/vagrant-chef/2acc2ee08afd057d4a815ed72ba085b1/cookbooks/logstash/recipes/default.rb
==> mha_master:
==> mha_master:  51: service "logstash" do
==> mha_master:  52:   supports :restart => true, :reload => false
==> mha_master:  53:   action :nothing
==> mha_master:  54:   provider Chef::Provider::Service::Upstart
==> mha_master:  55: end
==> mha_master:  56:
==> mha_master:
==> mha_master: Compiled Resource:
==> mha_master: ------------------
==> mha_master: # Declared in /tmp/vagrant-chef/2acc2ee08afd057d4a815ed72ba085b1/cookbooks/logstash/recipes/default.rb:51:in `from_file'
==> mha_master:
==> mha_master: service("logstash") do
==> mha_master:   provider Chef::Provider::Service::Upstart
==> mha_master:   action [:nothing]
==> mha_master:   supports {:restart=>true, :reload=>false}
==> mha_master:   retries 0
==> mha_master:   retry_delay 2
==> mha_master:   default_guard_interpreter :default
==> mha_master:   service_name "logstash"
==> mha_master:   pattern "logstash"
==> mha_master:   declared_type :service
==> mha_master:   cookbook_name :logstash
==> mha_master:   recipe_name "default"
==> mha_master: end
==> mha_master:
jmetzmeier commented 9 years ago

What version of CentOS? CentOS 6 also uses upstart, but it's an older version that's missing many features.

dtest commented 9 years ago

I am running CentOS 6.4

jmetzmeier commented 9 years ago

That makes sense. Looking at the error again, the system that produced the error is running upstart. The error is Upstart's poor way of saying the job file has a syntax error. We are probably using an upstart feature that is not present in the CentOS 6 version of upstart. We are providing the job file in bb_external and I think it's the "setuid" and "setgid" options that don't exist in the CentOS 6 upstart.

alexlovelltroy commented 9 years ago

can someone verify that changing the setuid and setgid options works for both Centos 6 and our ubuntu targets? @jmetzmeier ?