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

Support ubuntu/debian #23

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
version '0.1.3'

supports 'centos'
supports 'debian'
supports 'ubuntu'

recipe "chamber-kibana::default", <<-EOH
Installs Kibana 4 (with or without dependencies).
Expand All @@ -21,9 +23,9 @@
depends 'chef-sugar', '~> 2.4'
depends 'line', '~> 0.5'
depends 'ark', '~> 0.9'
depends 'java', '~> 1.28.0'
depends 'java', '~> 1.28'

# Optional dependencies
# FIX: 'depends' because of https://github.com/acrmp/foodcritic/issues/159
depends 'elasticsearch', '~> 0.3.10'
depends 'elasticsearch', '~> 0.3'
suggests 'logstash', '~> 0.9.2'
2 changes: 1 addition & 1 deletion recipes/_preconditions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
include_recipe 'chef-sugar::default'
require 'chef/sugar/core_extensions'

fail "Cookbook is incompatible with #{platform_family?}" unless centos?
fail "Cookbook is incompatible with #{platform_family?}" unless platform_family?('rhel', 'debian')
if node['kibana']['user'].blank?
fail 'Kibana user/group ownership attributes are missing'
end
7 changes: 1 addition & 6 deletions templates/default/kibana.init.erb
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,7 @@ start() {

echo -en "\033[1mStarting Kibana...\033[0m"
touch $PIDFILE && chown <%= node.kibana['user'] %> $PIDFILE
<% if node.platform_family == 'debian' %>
# TODO: Fix. Won't work, because of '-p' parameter
start-stop-daemon --background --start --quiet --pidfile $PIDFILE --chuid <%= node.kibana['user'] %> --exec <%= node.kibana['bindir'] %>/kibana -- -p $PIDFILE
<% else %>
su <%= node.kibana['user'] %> -c "nohup <%= node.kibana['bindir'] %>/kibana > <%= node.kibana['path']['logs'] %>/kibana.log 2>&1 & echo \$! > $PIDFILE"
<% end %>
su <%= node.kibana['user'] %> -c "nohup <%= node.kibana['bindir'] %>/kibana > <%= node.kibana['path']['logs'] %>/kibana.log 2>&1 & echo \$! > $PIDFILE"

if [ $? ]; then
echo -e " \e[32m[OK]\e[0m"
Expand Down