quirkey / vegas

Vegas aims to solve the simple problem of creating executable versions of Sinatra/Rack apps.
http://code.quirkey.com/vegas
MIT License
183 stars 24 forks source link

Vegas should trap 'HUP' and restart. #18

Open bobthecow opened 11 years ago

bobthecow commented 11 years ago

When a daemonized vegas app is killed with -HUP, it should restart with the same arguments and configuration options and working directory as before.

This would allow vegas apps to run:

Process.kill :HUP, Process.pid

... to reload themselves. It would also allow adding a --restart option to vegas:

def restart!
  pid = File.read(pid_file)
  logger.warn "Sending HUP to #{pid.to_i}"
  Process.kill(:HUP, pid.to_i)
end

See bobthecow/genghis#41

danielb2 commented 11 years ago

:+1:

Just to expand, this is useful if an app using Vegas has been upgraded to a new version in order to be able to restart it on the fly without an explicit shutdown etc.