Class: Puppet::Util::AtFork::Solaris

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/util/at_fork/solaris.rb

Overview

Solaris implementation of the Puppet::Util::AtFork handler. The callbacks defined in this implementation ensure the forked process runs in a different contract than the parent process. This is necessary in order for the child process to be able to survive termination of the contract its parent process runs in. This is needed notably for an agent run executed by a puppet agent service to be able to restart that service without being killed in the process as a consequence of running in the same contract as the service, as all processes in the contract are killed when the contract is terminated during the service restart.

Instance Method Summary collapse

Instance Method Details

#childObject



158
159
160
# File 'lib/puppet/util/at_fork/solaris.rb', line 158

def child
  deactivate_contract_template(false)
end

#parentObject



153
154
155
156
# File 'lib/puppet/util/at_fork/solaris.rb', line 153

def parent
  deactivate_contract_template(true)
  abandon_latest_child_contract
end

#prepareObject



149
150
151
# File 'lib/puppet/util/at_fork/solaris.rb', line 149

def prepare
  activate_new_contract_template
end