diff --git a/recipes/config.rb b/recipes/config.rb index 56feb47..d544455 100755 --- a/recipes/config.rb +++ b/recipes/config.rb @@ -61,11 +61,11 @@ service_action = node['filebeat']['disable_service'] ? [:disable, :stop] : [:enable, :nothing] if node['filebeat']['service']['init_style'] == 'runit' + runit_cmd = "/usr/share/filebeat/bin/filebeat -c #{node['filebeat']['conf_file']} -path.home /usr/share/filebeat -path.config #{node['filebeat']['conf_dir']} -path.data /var/lib/filebeat -path.logs /var/log/filebeat" runit_service 'filebeat' do options( 'user' => 'root', - 'conf_path' => node['filebeat']['conf_file'], - 'binary_path' => '/usr/bin/filebeat' + 'cmd' => runit_cmd ) default_logger true action service_action diff --git a/templates/default/sv-filebeat-run.erb b/templates/default/sv-filebeat-run.erb index a2f77c1..c40ed0a 100644 --- a/templates/default/sv-filebeat-run.erb +++ b/templates/default/sv-filebeat-run.erb @@ -1,3 +1,3 @@ #!/bin/sh exec 2>&1 -exec chpst -u <%= @options['user'] %> <%= @options['binary_path'] %> -c <%= @options['conf_path'] %> +exec chpst -u <%= @options['user'] %> <%= @options['cmd'] %>