lib/puppet/reports/wavefront.rb
# The PID of the init process. This is generally 1, but not in a
# Solaris or SmartOS zone
#
# @raise [String] 'UnknownOS' if it doesn't recognize the OS
# @return [Array[Integer]] the PID of the init process, or equivalent
#
The PID of the init process. This is generally 1, but not in a
Solaris or SmartOS zone
The PID of the init process . This is generally 1 but not in a Solaris or SmartOS zone
def init_pid
  if RbConfig::CONFIG['arch'] =~ /solaris/
    init_pid = `/bin/pgrep -fx /sbin/init`.to_i
    if `/usr/sbin/zoneadm list -p`.start_with?('0:')
      [init_pid]
    else
      [init_pid, `/bin/pgrep -fx zsched`.to_i]
    end
  else
    [1]
  end
end
def init_pid if RbConfig :: CONFIG [ 'arch' ] =~ / solaris / init_pid = ` /bin/pgrep -fx /sbin/init ` . to_i if ` /usr/sbin/zoneadm list -p ` . start_with? ( '0:' ) [ init_pid ] else [ init_pid , ` /bin/pgrep -fx zsched ` . to_i ] end else [ 1 ] end end
The PID of the init process.
The PID of the init process .
] the PID of the init process, or equivalent
] the PID of the init process or equivalent
Array[Integer
[String] 'UnknownOS' if it doesn't recognize the OS
[ String ] ' UnknownOS ' if it doesn ' t recognize the OS