WEBrickを使えば,daemonが簡単に作れるので,簡易daemonとして.
require 'webrick'
# Trap signal
Signal.trap(:TERM){
#
}
Signal.trap(:HUP){
#
}
Signal.trap(:INT){
exit 0
}
WEBrick::Daemon.start {
loop {
puts "processing..."
sleep 5
}
}
comments powered by Disqus