puppetlabs/mcollective-puppet-agent — pull request #11 by richardc (2014-01-10 15:36:25+00:00)
Title: MCO-31 Change method of running puppet to double-fork foreground run

Specifying `--daemonize --onetime` causes quite an amount of confusion by
running puppet as a daemon, but for the semantics of a one-off backgrounded
run. See PUP-1320 for more discussion of this issue.

This patch makes use of the usually uncalled
MCollective::Util:PuppetAgentMgr#run_in_foreground method, and then when
running a command from MCollective::Agent::Puppet#run we double-fork and exec
to dissasociate the process from the mcollective daemon, and run
optimistically in isolation. This is the same model as used on Windows,
brought to Unix flavours.