require 'sinatra' get '/long_process' do child_pid = Process.fork do # hard work is done here... sleep 10 Process.exit end Process.detach child_pid # No zombie process 'Doing hard work in the background...' end