jobby 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +21 -9
- data/bin/jobby +1 -1
- data/lib/server.rb +3 -3
- metadata +2 -2
data/README
CHANGED
@@ -19,6 +19,19 @@ right and has been extracted to work in a general manner.
|
|
19
19
|
* {Rubyforge}[http://jobby.rubyforge.org/]
|
20
20
|
|
21
21
|
|
22
|
+
== What happens when you run Jobby?
|
23
|
+
|
24
|
+
Jobby can be thought of as a self-managing daemon and client program rolled
|
25
|
+
into one. The first time you run Jobby, a daemon is started which listens for
|
26
|
+
connections on a socket. The daemon will fork every time it receives a
|
27
|
+
connection (up to --max-children, further requests are queued) and the forked
|
28
|
+
child will run whatever is specified by --ruby or --command.
|
29
|
+
|
30
|
+
The *same* 'jobby' call also runs a client program to connect to the daemon,
|
31
|
+
passing --input as a parameter which will be used by the child process.
|
32
|
+
Subsequent calls to 'jobby' will use the existing daemon.
|
33
|
+
|
34
|
+
|
22
35
|
== Usage
|
23
36
|
|
24
37
|
Jobby is a single 'binary' script that, can be run from the command line and is
|
@@ -54,17 +67,16 @@ passed every time jobby is called in this for loop, it is only actually read
|
|
54
67
|
and used the first time. I'll try to explain why below.
|
55
68
|
|
56
69
|
|
57
|
-
==
|
70
|
+
== Log rotation
|
58
71
|
|
59
|
-
|
60
|
-
into one. The first time you run Jobby, a daemon is started which listens for
|
61
|
-
connections on a socket. The daemon will fork every time it receives a
|
62
|
-
connection (up to --max-children, further requests are queued) and the forked
|
63
|
-
child will run whatever is specified by --ruby or --command.
|
72
|
+
Issue a HUP signal to tell a Jobby process that the log file has been rotated. You need to do this for all Jobby processes.
|
64
73
|
|
65
|
-
|
66
|
-
|
67
|
-
|
74
|
+
|
75
|
+
== Stopping Jobby
|
76
|
+
|
77
|
+
Sending a USR1 signal to the Jobby daemon process (jobbyd) will gracefully shutdown Jobby. The daemon process will stop accepting any more connections and close the socket. It will honour anything in the queue and wait until all the children have exited before exiting itself. In the meantime, you can start another Jobby daemon on the old socket.
|
78
|
+
|
79
|
+
Sending a TERM signal to the Jobby daemon process (jobbyd) will terminate the related Jobby processes immediately (kill -9 the children, then exit the daemon).
|
68
80
|
|
69
81
|
|
70
82
|
== Running multiple Jobby daemons
|
data/bin/jobby
CHANGED
data/lib/server.rb
CHANGED
@@ -99,8 +99,8 @@ module Jobby
|
|
99
99
|
$stdout.reopen(@log)
|
100
100
|
$stderr.reopen(@log)
|
101
101
|
else
|
102
|
-
$stdout.reopen(@log, "
|
103
|
-
$stderr.reopen(@log, "
|
102
|
+
$stdout.reopen(@log, "a+")
|
103
|
+
$stderr.reopen(@log, "a+")
|
104
104
|
end
|
105
105
|
end
|
106
106
|
|
@@ -231,7 +231,7 @@ module Jobby
|
|
231
231
|
@logger.info "Terminating server #{Process.pid}"
|
232
232
|
@socket.close unless @socket.closed?
|
233
233
|
FileUtils.rm(@socket_path, :force => true)
|
234
|
-
exit
|
234
|
+
exit 0
|
235
235
|
end
|
236
236
|
|
237
237
|
# Stops any more children being forked and terminates the existing ones. A kill
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jobby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Somerville
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-11-
|
12
|
+
date: 2008-11-14 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|