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



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

def child
  deactivate_contract_template(false)
end

#parentObject



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

def parent
  deactivate_contract_template(true)
  abandon_latest_child_contract
end

#prepareObject



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

def prepare
  activate_new_contract_template
end