unicorn-ctl 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +4 -0
- data/README.md +5 -5
- data/bin/unicornctl +26 -0
- metadata +1 -1
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
## unicornctl - unicorn/rainbows control script
|
2
2
|
|
3
|
-
`unicornctl` is a simple and easy to use console tool for managing ruby applications using
|
4
|
-
rainbows application
|
5
|
-
|
6
|
-
|
7
|
-
Redhat-style startup script example).
|
3
|
+
`unicornctl` is a simple and easy to use console tool for managing ruby applications using
|
4
|
+
[unicorn](http://unicorn.bogomips.org/) or [rainbows](http://rainbows.rubyforge.org/) application servers.
|
5
|
+
The tool provides a set of reliable commands to start/stop/restart unicorn instances or upgrade them
|
6
|
+
without or with minimal downtime. `unicornctl` script could easily be used as a base for a startup
|
7
|
+
script for unix operating systems (see examples directory for a Redhat-style startup script example).
|
8
8
|
|
9
9
|
Please note, that this is still an alpha-quality software and it could have many issues. If you try it and
|
10
10
|
find any problems, feel free to report them using [Github Issues page](https://github.com/swiftype/unicorn-ctl/issues).
|
data/bin/unicornctl
CHANGED
@@ -13,6 +13,7 @@ VALID_COMMANDS = %w[
|
|
13
13
|
restart
|
14
14
|
force-restart
|
15
15
|
upgrade
|
16
|
+
reopen-logs
|
16
17
|
]
|
17
18
|
|
18
19
|
#---------------------------------------------------------------------------------------------------
|
@@ -353,6 +354,28 @@ def upgrade_application!(options)
|
|
353
354
|
puts "OK: Upgrade is done successfully!"
|
354
355
|
end
|
355
356
|
|
357
|
+
#---------------------------------------------------------------------------------------------------
|
358
|
+
def reopen_logs!(options)
|
359
|
+
# Check pid file
|
360
|
+
pid_file = unicorn_pid_file(options)
|
361
|
+
unless File.exists?(pid_file)
|
362
|
+
puts "OK: The process is not running"
|
363
|
+
exit(0)
|
364
|
+
end
|
365
|
+
|
366
|
+
pid = read_pid(pid_file)
|
367
|
+
if pid_running?(pid)
|
368
|
+
puts "Sending USR1 signal to process with pid=#{pid}..."
|
369
|
+
send_signal('USR1', pid)
|
370
|
+
else
|
371
|
+
puts "WARNING: Slate pid file found, removing it: #{pid_file}"
|
372
|
+
FileUtils.rm(pid_file)
|
373
|
+
end
|
374
|
+
|
375
|
+
puts "Done!"
|
376
|
+
exit(0)
|
377
|
+
end
|
378
|
+
|
356
379
|
#---------------------------------------------------------------------------------------------------
|
357
380
|
def show_help(error = nil)
|
358
381
|
puts "ERROR: #{error}\n\n" if error
|
@@ -475,6 +498,9 @@ case command
|
|
475
498
|
when 'upgrade'
|
476
499
|
upgrade_application!(options)
|
477
500
|
|
501
|
+
when 'reopen-logs'
|
502
|
+
reopen_logs!(options)
|
503
|
+
|
478
504
|
else
|
479
505
|
show_help("ERROR: Invalid command: #{command}")
|
480
506
|
end
|