God ignores the TERM signal. Maybe this is a ruby thing? I’m not really going to bother looking. But when trying to run God inside runit, which normally sends a TERM when you tell it to stop a process; this is no good. It looks like God ignores HUP if run as a daemon:
def run_daemonized # trap and ignore SIGHUP Signal.trap('HUP') {}
In which case the only way I could find to stop it is with an INT signal. But HUP will kill it when run non-daemonized with the “-D” option. I guess mysql and other daemons do this sorta thing too and I got the idea from this thread. For other processes see this archive of runit scripts for something that works or examples. Anyways, my runit run script for god:
#!/bin/sh exec 2>&1 trap 'kill -HUP %1' 1 2 13 15 /usr/bin/god -D -c /etc/god/master.god --log-level debug --no-syslog & wait
I’d like to suggest to use monit, I had bad experience with god, if it run long time, it can take a lot of RAM, I saw one god process that took 600Mb of RAM. This was the sign to get rid of it.
@VitalieL,
But the God RubyForge site says god is “Like monit, only awesome”!
Some consultants/friends have used God in the past, so I’m mostly working off experience here. I don’t have particular favoritism to either myself at this point.