diff --git a/spec/ubuntu_package_spec.rb b/spec/ubuntu_package_spec.rb index f98a0ec..8d69341 100644 --- a/spec/ubuntu_package_spec.rb +++ b/spec/ubuntu_package_spec.rb @@ -12,7 +12,7 @@ it 'renders the nrpe config' do expect(chef_run).to render_file('/etc/nagios/nrpe.cfg').with_content('include_dir=/etc/nagios/') - expect(chef_run).to render_file('/etc/nagios/nrpe.cfg').with_content('pid_file=/var/run/nagios/nrpe.pid') + expect(chef_run).to render_file('/etc/nagios/nrpe.cfg').with_content('pid_file=/var/run/nrpe/nrpe.pid') end it 'creates nrpe.d directory' do diff --git a/templates/default/nagios-nrpe-server.erb b/templates/default/nagios-nrpe-server.erb index 1e70bd5..af2e51e 100644 --- a/templates/default/nagios-nrpe-server.erb +++ b/templates/default/nagios-nrpe-server.erb @@ -37,6 +37,7 @@ case "$1" in start) # Start daemon. echo -n "Starting <%= node['nrpe']['service_name'] %>: " + install -o <%= node['nrpe']['user'] %> -g <%= node['nrpe']['group'] %> -d `dirname $PidFile` <% if ['rhel', 'fedora'].include?(node['platform_family']) -%>daemon $NrpeBin -c $NrpeCfg -d<% else -%>start-stop-daemon --start --quiet --exec $NrpeBin -- -c $NrpeCfg -d<% end -%> echo ;;