Launchd service is unloaded instead of refreshing

21 views
Skip to first unread message

Pascal Robert

unread,
Jul 29, 2015, 2:54:28 PM7/29/15
to Puppet Users
Hi,


We use Puppet for many things, including managing the Nagios client (NRPE) on OS X and Linux. I have a weird issue where on OS X, when Puppet should refresh the service because of a configuration file change, well it unload the service instead :-/


Relevant config:


$nrpe_config_file = $operatingsystem ? {
ubuntu => '/etc/nagios/nrpe_local.cfg',
debian => '/etc/nagios/nrpe_local.cfg',
centos => '/etc/nagios/nrpe.cfg',
darwin => '/opt/local/etc/nrpe/nrpe.cfg',
default => '/etc/nagios/nrpe.conf'
}


$nrpe_service_name = $operatingsystem ? {
ubuntu => 'nagios-nrpe-server',
debian => 'nagios-nrpe-server',
centos => 'nrpe',
darwin => 'org.macports.nrpe',
default => 'nrpe'
}


file { 'nrpe_config_file':
ensure => 'present',
path => "${nrpe_config_file}",
owner => "${nrpe_config_file_owner}",
group => "${nrpe_config_file_group}",
mode => '0755',
content => template("nagios/${nrpe_template_file}"),
require => Package['nrpe'],
}


service { 'nrpe_service':
ensure => running,
name => "${nrpe_service_name}",
hasstatus => true,
hasrestart => true,
enable => true,
require => [ Package['nrpe'], File['nrpe_config_file'] ],
subscribe => File['nrpe_config_file'],
}


When the content of 'nrpe_config_file' changes, Puppet's log says:


  Notice: /Stage[main]/Nagios::Client/Service[nrpe_service]: Triggered 'refresh' from 1 events


But instead, org.macports.nrpe is unloaded from launchd, and I have to load it manually with 'launchctl load -w /Library/LaunchDaemons/org.macports.nrpe.plist'.

It's with Puppet 3.7.5 and 3.7.4.
Reply all
Reply to author
Forward
0 new messages