README.md in bluepill-0.0.51 vs README.md in bluepill-0.0.52
- old
+ new
@@ -117,10 +117,27 @@
process.checks :mem_usage, :every => 10.seconds, :below => 100.megabytes, :times => [3,5]
end
end
```
+If you want to include one or more supplementary groups:
+
+```ruby
+ Bluepill.application("app_name") do |app|
+ app.process("process_name") do |process|
+ process.start_command = "/usr/bin/some_start_command"
+ process.pid_file = "/tmp/some_pid_file.pid"
+ process.uid = "deploy"
+ process.gid = "deploy"
+ process.supplementary_groups = ['rvm']
+
+ process.checks :cpu_usage, :every => 10.seconds, :below => 5, :times => 3
+ process.checks :mem_usage, :every => 10.seconds, :below => 100.megabytes, :times => [3,5]
+ end
+ end
+```
+
You can also set an app-wide uid/gid:
```ruby
Bluepill.application("app_name") do |app|
app.uid = "deploy"
@@ -161,9 +178,38 @@
end
end
```
Note: We also set the PWD in the environment to the working dir you specify. This is useful for when the working dir is a symlink. Unicorn in particular will cd into the environment variable in PWD when it re-execs to deal with a change in the symlink.
+
+By default, bluepill will send a SIGTERM to your process when stopping.
+To change the stop command:
+
+```ruby
+ Bluepill.application("app_name") do |app|
+ app.process("process_name") do |process|
+ process.start_command = "/usr/bin/some_start_command"
+ process.pid_file = "/tmp/some_pid_file.pid"
+ process.stop_command = "/user/bin/some_stop_command"
+ end
+ end
+```
+
+If you'd like to send a signal or signals to your process to stop it:
+
+```ruby
+ Bluepill.application("app_name") do |app|
+ app.process("process_name") do |process|
+ process.start_command = "/usr/bin/some_start_command"
+ process.pid_file = "/tmp/some_pid_file.pid"
+ process.stop_signals = [:quit, 30.seconds, :term, 5.seconds, :kill]
+ end
+ end
+```
+
+We added a line that will send a SIGQUIT, wait 30 seconds and check to
+see if the process is still up, send a SIGTERM, wait 5 seconds and check
+to see if the process is still up, and finally send a SIGKILL.
And lastly, to monitor child processes:
```ruby
process.monitor_children do |child_process|
\ No newline at end of file