mlanett-daemons 1.0.13 → 1.1.10.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +12 -2
- data/LICENSE +1 -8
- data/README-mlanett.rdoc +8 -0
- data/{README → README.rdoc} +6 -15
- data/Releases +84 -9
- data/TODO +1 -5
- data/daemons.gemspec +1 -0
- data/examples/call/call.rb +1 -0
- data/examples/daemonize/daemonize.rb +10 -3
- data/examples/run/ctrl_hanging.rb +19 -0
- data/examples/run/ctrl_monitor_multiple.rb +18 -0
- data/examples/run/ctrl_normal.rb +0 -1
- data/examples/run/ctrl_proc.rb.output +20 -0
- data/examples/run/ctrl_proc_rand.rb +23 -0
- data/examples/run/ctrl_slowstop.rb +16 -0
- data/examples/run/myserver_crashing.rb +2 -2
- data/examples/run/myserver_hanging.rb +21 -0
- data/examples/run/myserver_slowstop.rb +21 -0
- data/lib/daemons.rb +38 -10
- data/lib/daemons/application.rb +131 -26
- data/lib/daemons/application_group.rb +58 -10
- data/lib/daemons/change_privilege.rb +19 -0
- data/lib/daemons/cmdline.rb +10 -6
- data/lib/daemons/controller.rb +5 -2
- data/lib/daemons/daemonize.rb +64 -150
- data/lib/daemons/etc_extension.rb +12 -0
- data/lib/daemons/exceptions.rb +3 -0
- data/lib/daemons/monitor.rb +27 -19
- data/lib/daemons/pid.rb +13 -14
- data/lib/daemons/pidfile.rb +14 -7
- data/lib/daemons/pidmem.rb +9 -0
- data/lib/daemons/version.rb +1 -1
- data/spec/pidfile_spec.rb +12 -0
- data/spec/spec_helper.rb +1 -0
- metadata +31 -47
- data/daemons.tmproj +0 -56
- data/examples/run/myserver_crashing.rb.output +0 -30
- data/html/classes/Daemonize.html +0 -497
- data/html/classes/Daemons.html +0 -683
- data/html/classes/Daemons/Application.html +0 -836
- data/html/classes/Daemons/ApplicationGroup.html +0 -508
- data/html/classes/Daemons/CmdException.html +0 -113
- data/html/classes/Daemons/Controller.html +0 -429
- data/html/classes/Daemons/Error.html +0 -113
- data/html/classes/Daemons/Exception.html +0 -111
- data/html/classes/Daemons/Monitor.html +0 -263
- data/html/classes/Daemons/Optparse.html +0 -244
- data/html/classes/Daemons/Pid.html +0 -339
- data/html/classes/Daemons/PidFile.html +0 -441
- data/html/classes/Daemons/PidMem.html +0 -126
- data/html/classes/Daemons/RuntimeException.html +0 -113
- data/html/classes/Daemons/SystemError.html +0 -163
- data/html/created.rid +0 -1
- data/html/files/README.html +0 -377
- data/html/files/Releases.html +0 -342
- data/html/files/TODO.html +0 -121
- data/html/files/lib/daemons/application_group_rb.html +0 -101
- data/html/files/lib/daemons/application_rb.html +0 -110
- data/html/files/lib/daemons/cmdline_rb.html +0 -101
- data/html/files/lib/daemons/controller_rb.html +0 -101
- data/html/files/lib/daemons/daemonize_rb.html +0 -207
- data/html/files/lib/daemons/exceptions_rb.html +0 -101
- data/html/files/lib/daemons/monitor_rb.html +0 -108
- data/html/files/lib/daemons/pid_rb.html +0 -108
- data/html/files/lib/daemons/pidfile_rb.html +0 -108
- data/html/files/lib/daemons/pidmem_rb.html +0 -108
- data/html/files/lib/daemons_rb.html +0 -117
- data/html/fr_class_index.html +0 -41
- data/html/fr_file_index.html +0 -40
- data/html/fr_method_index.html +0 -91
- data/html/index.html +0 -24
- data/html/rdoc-style.css +0 -208
- data/test/call_as_daemon.rb +0 -12
- data/test/tc_main.rb +0 -24
- data/test/test1.rb +0 -19
- data/test/testapp.rb +0 -11
data/html/files/Releases.html
DELETED
@@ -1,342 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>File: Releases</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="fileHeader">
|
50
|
-
<h1>Releases</h1>
|
51
|
-
<table class="header-table">
|
52
|
-
<tr class="top-aligned-row">
|
53
|
-
<td><strong>Path:</strong></td>
|
54
|
-
<td>Releases
|
55
|
-
</td>
|
56
|
-
</tr>
|
57
|
-
<tr class="top-aligned-row">
|
58
|
-
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>Tue Aug 25 22:31:41 -0700 2009</td>
|
60
|
-
</tr>
|
61
|
-
</table>
|
62
|
-
</div>
|
63
|
-
<!-- banner header -->
|
64
|
-
|
65
|
-
<div id="bodyContent">
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
<div id="contextContent">
|
70
|
-
|
71
|
-
<div id="description">
|
72
|
-
<h1><a href="../classes/Daemons.html">Daemons</a> Release History</h1>
|
73
|
-
<h2>Release 1.0.10: November 16, 2007</h2>
|
74
|
-
<ul>
|
75
|
-
<li>By default, we now delete stray pid-files (i.e. pid-files which result for
|
76
|
-
example from a killed daemon) automatically. This function can be
|
77
|
-
deactivated by passing :keep_pid_files => true as an option.
|
78
|
-
|
79
|
-
</li>
|
80
|
-
<li>All pid files of :multiple daemons new get deleted correctly upon exit of
|
81
|
-
the daemons (reported by Han Holl).
|
82
|
-
|
83
|
-
</li>
|
84
|
-
<li>Use the signal ‘KILL’ instead of ‘TERM’ on Windows
|
85
|
-
platforms.
|
86
|
-
|
87
|
-
</li>
|
88
|
-
<li>Use exit! in trap(‘TERM’) instead of exit when option
|
89
|
-
:hard_exit is given (thanks to Han Holl).
|
90
|
-
|
91
|
-
</li>
|
92
|
-
<li>Did some clarification on the exception log.
|
93
|
-
|
94
|
-
</li>
|
95
|
-
</ul>
|
96
|
-
<h2>Release 1.0.9: October 29, 2007</h2>
|
97
|
-
<ul>
|
98
|
-
<li>fixed a severe bug in the new Pid.running? function: function returned true
|
99
|
-
if the process did not exist (thanks to Jeremy Lawler).
|
100
|
-
|
101
|
-
</li>
|
102
|
-
</ul>
|
103
|
-
<h2>Release 1.0.8: September 24, 2007</h2>
|
104
|
-
<ul>
|
105
|
-
<li>new Pid.running? function. Checking whether a process exists by sending
|
106
|
-
signal ‘0’ (thanks to Dru Nelson).
|
107
|
-
|
108
|
-
</li>
|
109
|
-
</ul>
|
110
|
-
<h2>Release 1.0.7: July 7, 2007</h2>
|
111
|
-
<ul>
|
112
|
-
<li>Patch to fix wrong ARGV when using :exec (in def start_exec:
|
113
|
-
Kernel.exec(script(), *(@app_argv || []))) (thanks to Alex McGuire).
|
114
|
-
|
115
|
-
</li>
|
116
|
-
</ul>
|
117
|
-
<h2>Release 1.0.6: Mai 8, 2007</h2>
|
118
|
-
<ul>
|
119
|
-
<li>New option to pass an ARGV-style array to run and run_proc (thanks to Marc
|
120
|
-
Evans).
|
121
|
-
|
122
|
-
</li>
|
123
|
-
<li>Additional patches for ’/var/log’ (thanks to Marc Evans).
|
124
|
-
|
125
|
-
</li>
|
126
|
-
</ul>
|
127
|
-
<h2>Release 1.0.5: February 24, 2007</h2>
|
128
|
-
<ul>
|
129
|
-
<li>Applied patch that makes daemons to use ’/var/log’ as logfile
|
130
|
-
directory if you use :dir_mode = :system (thanks to Han Holl).
|
131
|
-
|
132
|
-
</li>
|
133
|
-
<li><a href="../classes/Daemons.html">Daemons</a> should now work with Ruby 1.9
|
134
|
-
(at least the basic features).
|
135
|
-
|
136
|
-
</li>
|
137
|
-
</ul>
|
138
|
-
<h2>Release 1.0.4: January 17, 2007</h2>
|
139
|
-
<ul>
|
140
|
-
<li>Document the :log_output option (thanks to Andrew Kuklewicz).
|
141
|
-
|
142
|
-
</li>
|
143
|
-
<li>Set STDOUT.sync = true when redirecting to a logfile (thanks to Andrew
|
144
|
-
Kuklewicz).
|
145
|
-
|
146
|
-
</li>
|
147
|
-
<li>Should now run also correctly when there is no working ‘ps ax’
|
148
|
-
on the system (thanks to Daniel Kehoe).
|
149
|
-
|
150
|
-
</li>
|
151
|
-
</ul>
|
152
|
-
<h2>Release 1.0.3: November 1, 2006</h2>
|
153
|
-
<ul>
|
154
|
-
<li>Set the app_name correctly also for the monitor process (thanks to Ilya
|
155
|
-
Novoselov).
|
156
|
-
|
157
|
-
</li>
|
158
|
-
</ul>
|
159
|
-
<h2>Release 1.0.2: September 26, 2006</h2>
|
160
|
-
<ul>
|
161
|
-
<li>Changed the ‘ps -ax’ call back to ‘ps ax’.
|
162
|
-
|
163
|
-
</li>
|
164
|
-
<li>Fixed the documentation for the :normal :dir_mode.
|
165
|
-
|
166
|
-
</li>
|
167
|
-
<li>As a default for <a
|
168
|
-
href="../classes/Daemons.html#M000002">Daemons.run_proc</a>, the pid file
|
169
|
-
is now saved in the current directory.
|
170
|
-
|
171
|
-
</li>
|
172
|
-
<li>In :ontop mode for running a proc (this is equal to calling something like
|
173
|
-
‘ruby ctrl_proc.rb run’), the proc now runs directly in the
|
174
|
-
calling script, not in a forked process anymore (thanks to Paul Butcher).
|
175
|
-
|
176
|
-
</li>
|
177
|
-
<li>Set $0 to app_name in the daemons (thanks to Ilya Novoselov).
|
178
|
-
|
179
|
-
</li>
|
180
|
-
</ul>
|
181
|
-
<h2>Release 1.0.1: August 30, 2006</h2>
|
182
|
-
<ul>
|
183
|
-
<li>Fixed a regex for parsing the ‘ps ax’ system call. (thanks to
|
184
|
-
Garance Alistair Drosehn)
|
185
|
-
|
186
|
-
</li>
|
187
|
-
</ul>
|
188
|
-
<h2>Release 1.0.0: August 29, 2006</h2>
|
189
|
-
<ul>
|
190
|
-
<li>Fix the parsing of the ‘ps ax’ system call. (thanks to Garance
|
191
|
-
Alistair Drosehn)
|
192
|
-
|
193
|
-
</li>
|
194
|
-
</ul>
|
195
|
-
<h2>Release 0.4.4: February 14, 2006</h2>
|
196
|
-
<ul>
|
197
|
-
<li>Several fixes that allow us to use the <a
|
198
|
-
href="../classes/Daemons/Controller.html">Daemons::Controller</a> with a
|
199
|
-
proc instead of wrapping a script file. This gives us all the PID file
|
200
|
-
management, monitoring, command line options, etc. without having to
|
201
|
-
specify a path to our script which can be tricky, especially when using
|
202
|
-
RubyGems. (thanks to John-Mason Shackelford)
|
203
|
-
|
204
|
-
</li>
|
205
|
-
</ul>
|
206
|
-
<h2>Release 0.4.3: November 29, 2005</h2>
|
207
|
-
<ul>
|
208
|
-
<li>New Option: You can specify the name of the application with :app_name on
|
209
|
-
calling <a href="../classes/Daemons.html#M000001">Daemons.run</a>. This
|
210
|
-
will be used to contruct the name of the pid files and log files. Defaults
|
211
|
-
to the basename of the script. (thanks to Stephen R. Veit)
|
212
|
-
|
213
|
-
</li>
|
214
|
-
<li>Bugfix: Handle the case where no controller options are given when calling
|
215
|
-
<a href="../classes/Daemons.html">Daemons</a>, just options after
|
216
|
-
"—". (thanks to Stephen R. Veit)
|
217
|
-
|
218
|
-
</li>
|
219
|
-
</ul>
|
220
|
-
<h2>Release 0.4.2: November 15, 2005</h2>
|
221
|
-
<ul>
|
222
|
-
<li>Bugfix for problem with :normal pid-file directory mode (pid.rb), fixed
|
223
|
-
(thanks to Stephen R. Veit)
|
224
|
-
|
225
|
-
</li>
|
226
|
-
</ul>
|
227
|
-
<h2>Release 0.4.1: September 11, 2005</h2>
|
228
|
-
<ul>
|
229
|
-
<li>Bugfix for ‘run’ command line mode: didn‘t work anymore
|
230
|
-
in 0.4.0, fixed
|
231
|
-
|
232
|
-
</li>
|
233
|
-
</ul>
|
234
|
-
<h2>Release 0.4.0: July 30, 2005</h2>
|
235
|
-
<ul>
|
236
|
-
<li>Two completely new operation modes:
|
237
|
-
|
238
|
-
<ol>
|
239
|
-
<li>Call a block as a daemon (<tt><a
|
240
|
-
href="../classes/Daemons.html#M000003">Daemons.call</a> { my_daemon_code
|
241
|
-
}</tt>) and control it from the parent process.
|
242
|
-
|
243
|
-
</li>
|
244
|
-
<li><a href="../classes/Daemonize.html">Daemonize</a> the currently running
|
245
|
-
process (<tt><a
|
246
|
-
href="../classes/Daemons.html#M000004">Daemons.daemonize</a></tt>)
|
247
|
-
|
248
|
-
</li>
|
249
|
-
</ol>
|
250
|
-
<p>
|
251
|
-
plus the already existing mode to control your scripts (<tt><a
|
252
|
-
href="../classes/Daemons.html#M000001">Daemons.run</a>("script.rb")</tt>)
|
253
|
-
</p>
|
254
|
-
</li>
|
255
|
-
<li>Improved documentation (for example "How does the daemonization
|
256
|
-
process work?")
|
257
|
-
|
258
|
-
</li>
|
259
|
-
<li>Improved "simulation mode" (<tt>:ontop</tt> option)
|
260
|
-
|
261
|
-
</li>
|
262
|
-
<li>Some minor bugfixes
|
263
|
-
|
264
|
-
</li>
|
265
|
-
</ul>
|
266
|
-
<h2>Release 0.3.0: April 21, 2005</h2>
|
267
|
-
<ul>
|
268
|
-
<li>New monitor functionality: automatic restarting of your applications if
|
269
|
-
they crash
|
270
|
-
|
271
|
-
</li>
|
272
|
-
<li>‘restart’ command fixed
|
273
|
-
|
274
|
-
</li>
|
275
|
-
<li>’—force’ command modifier (please refer to the
|
276
|
-
documentation)
|
277
|
-
|
278
|
-
</li>
|
279
|
-
<li>Some more bugfixes and improvements
|
280
|
-
|
281
|
-
</li>
|
282
|
-
</ul>
|
283
|
-
<h2>Release 0.2.1: Mar 21, 2005</h2>
|
284
|
-
<ul>
|
285
|
-
<li>Bugfix for a problem with the ‘status’ command
|
286
|
-
|
287
|
-
</li>
|
288
|
-
</ul>
|
289
|
-
<h2>Release 0.2.0: Mar 21, 2005</h2>
|
290
|
-
<ul>
|
291
|
-
<li>Exception backtrace functionality added
|
292
|
-
|
293
|
-
</li>
|
294
|
-
<li>Exec functionality added
|
295
|
-
|
296
|
-
</li>
|
297
|
-
<li>More examples added
|
298
|
-
|
299
|
-
</li>
|
300
|
-
<li>New commands: status, zap
|
301
|
-
|
302
|
-
</li>
|
303
|
-
</ul>
|
304
|
-
<h2>Release 0.0.1: Feb 8, 2005</h2>
|
305
|
-
<ul>
|
306
|
-
<li>Initial release
|
307
|
-
|
308
|
-
</li>
|
309
|
-
</ul>
|
310
|
-
|
311
|
-
</div>
|
312
|
-
|
313
|
-
|
314
|
-
</div>
|
315
|
-
|
316
|
-
|
317
|
-
</div>
|
318
|
-
|
319
|
-
|
320
|
-
<!-- if includes -->
|
321
|
-
|
322
|
-
<div id="section">
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
<!-- if method_list -->
|
332
|
-
|
333
|
-
|
334
|
-
</div>
|
335
|
-
|
336
|
-
|
337
|
-
<div id="validator-badges">
|
338
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
339
|
-
</div>
|
340
|
-
|
341
|
-
</body>
|
342
|
-
</html>
|
data/html/files/TODO.html
DELETED
@@ -1,121 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
-
<!DOCTYPE html
|
3
|
-
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
-
|
6
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
-
<head>
|
8
|
-
<title>File: TODO</title>
|
9
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
-
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
-
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
-
<script type="text/javascript">
|
13
|
-
// <![CDATA[
|
14
|
-
|
15
|
-
function popupCode( url ) {
|
16
|
-
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
-
}
|
18
|
-
|
19
|
-
function toggleCode( id ) {
|
20
|
-
if ( document.getElementById )
|
21
|
-
elem = document.getElementById( id );
|
22
|
-
else if ( document.all )
|
23
|
-
elem = eval( "document.all." + id );
|
24
|
-
else
|
25
|
-
return false;
|
26
|
-
|
27
|
-
elemStyle = elem.style;
|
28
|
-
|
29
|
-
if ( elemStyle.display != "block" ) {
|
30
|
-
elemStyle.display = "block"
|
31
|
-
} else {
|
32
|
-
elemStyle.display = "none"
|
33
|
-
}
|
34
|
-
|
35
|
-
return true;
|
36
|
-
}
|
37
|
-
|
38
|
-
// Make codeblocks hidden by default
|
39
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
-
|
41
|
-
// ]]>
|
42
|
-
</script>
|
43
|
-
|
44
|
-
</head>
|
45
|
-
<body>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<div id="fileHeader">
|
50
|
-
<h1>TODO</h1>
|
51
|
-
<table class="header-table">
|
52
|
-
<tr class="top-aligned-row">
|
53
|
-
<td><strong>Path:</strong></td>
|
54
|
-
<td>TODO
|
55
|
-
</td>
|
56
|
-
</tr>
|
57
|
-
<tr class="top-aligned-row">
|
58
|
-
<td><strong>Last Update:</strong></td>
|
59
|
-
<td>Tue Aug 25 22:22:46 -0700 2009</td>
|
60
|
-
</tr>
|
61
|
-
</table>
|
62
|
-
</div>
|
63
|
-
<!-- banner header -->
|
64
|
-
|
65
|
-
<div id="bodyContent">
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
<div id="contextContent">
|
70
|
-
|
71
|
-
<div id="description">
|
72
|
-
<ul>
|
73
|
-
<li>write the README (2005-02-07) <b>DONE</b>
|
74
|
-
|
75
|
-
</li>
|
76
|
-
<li>write some real tests (2005-02-08)
|
77
|
-
|
78
|
-
</li>
|
79
|
-
<li>document the new options (2005-03-14) <b>DONE</b>
|
80
|
-
|
81
|
-
</li>
|
82
|
-
<li>start/stop with —force options (2005-04-05)
|
83
|
-
|
84
|
-
</li>
|
85
|
-
<li>option to give some console output on start/stop commands (2005-04-05)
|
86
|
-
|
87
|
-
</li>
|
88
|
-
</ul>
|
89
|
-
|
90
|
-
</div>
|
91
|
-
|
92
|
-
|
93
|
-
</div>
|
94
|
-
|
95
|
-
|
96
|
-
</div>
|
97
|
-
|
98
|
-
|
99
|
-
<!-- if includes -->
|
100
|
-
|
101
|
-
<div id="section">
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
<!-- if method_list -->
|
111
|
-
|
112
|
-
|
113
|
-
</div>
|
114
|
-
|
115
|
-
|
116
|
-
<div id="validator-badges">
|
117
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
118
|
-
</div>
|
119
|
-
|
120
|
-
</body>
|
121
|
-
</html>
|