Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Increment/decrement processes #21

Open
mbdev opened this Issue · 2 comments

2 participants

@mbdev

This is a feature request of course, but I'd like to be able to increment or decrement processes. Ideally I would like something like the following

$ god increment group1 4
# or
$ god +1 group1
# then w.start is called, another process is started and monitored.
@d11wtq

+1. Is there a way to currently do this 'unofficially'? We add/remove unicorn workers through a shell script that invokes kill with either TTIN or TTOU, but keeping everything in God would be excellent.

@d11wtq

I'm thinking something like:

God.watch do |w|
  w.name     = "unicorn"
  w.pid_file = "/path/to/unicorn.pid"
  ... snip ...

  w.action :incr, "kill -TTIN `cat #{w.pid_file}`"
  w.action :decr, "kill -TTOU `cat #{w.pid_file}`"
end

I guess with support for a Proc instead of a String, like the other commands too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.