class Launchy::Detect::Runner::Forkable

Public Instance Methods

wet_run( cmd, *args ) click to toggle source
# File lib/launchy/detect/runner.rb, line 103
def wet_run( cmd, *args )
  child_pid = fork do
    close_file_descriptors unless Launchy.debug?
    Launchy.log("wet_run: before exec in child process")
    exec( *shell_commands( cmd, *args ))
    exit!
  end
  Process.detach( child_pid )
end

Private Instance Methods

close_file_descriptors() click to toggle source
# File lib/launchy/detect/runner.rb, line 113
def close_file_descriptors
  [$stdin, $stdout, $stderr].each do |io|
    io.reopen( "/dev/null", "r+" )
  end
end