Skip to content

Instantly share code, notes, and snippets.

@petyosi
Created October 2, 2009 06:28
Show Gist options
  • Save petyosi/199511 to your computer and use it in GitHub Desktop.
Save petyosi/199511 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'ruby-debug'
pid = fork do
$stderr.reopen(File.open("/dev/null", "w"))
exec("lftp -c 'sleep 100000'")
end
puts "forked with #{pid}\n"
Process.detach(pid)
Process.kill("TERM", pid)
puts `ps aux | grep lftp`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment