Hi,
Refresh doesn't seem to be working with the launched service provider on OS X
Lion (10.7.4).
I've come up with a simple "service" script, plist file and puppet script to
apply to demonstrate. The problem.
Here's the shell script which logs an initial starting message and then just
loops logging a "Still running…" message.
/usr/local/bin/example.sh:
#!/bin/sh
# We need to trap on TERM signals, according to Apple's launchd docs:
#
trap 'exit 1' 15
syslog -s -l 1 example.sh: Starting...
while true; do
sleep 15
syslog -s -l 1 example.sh: Still running...
done
Here's the launchd plist.
/Library/LaunchDaemons/net.davidlballenger.example.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>net.davidlballenger.example</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/example.sh</string>
</array>
</dict>
</plist>
Here's the example.pp file:
$service_name = 'net.davidlballenger.example'
$file_path = "/var/tmp/${service_name}"
file { $file_path :
content => $uptime_seconds ,
}
service { $service_name :
ensure => running,
enable => true,
subscribe => File[ $file_path ],
}
The File resource is updated with the facter variable $uptime_seconds each time
it runs. And the Service subscribes to the that File resource.
Assuming the script and plist file are in the appropriate places, then applying
example.pp will start the service if it is not already running. But subsequent
runs will not restart it, even though the log messages say that the file's
content changed and that it triggered a refresh of the service.
If I run the apply with --debug, the only launchctl command that I see in the
output is a launchctl list command.
Does anyone see anything wrong with the above files, or should I submit a bug
report.
Thanks - David
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.