mlanett-daemons 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. data/.gitignore +1 -0
  2. data/Gemfile +4 -0
  3. data/Gemfile.lock +17 -0
  4. data/LICENSE +29 -0
  5. data/README +223 -0
  6. data/Rakefile +15 -0
  7. data/Releases +126 -0
  8. data/TODO +6 -0
  9. data/daemons.gemspec +27 -0
  10. data/daemons.tmproj +56 -0
  11. data/examples/call/call.rb +56 -0
  12. data/examples/call/call.rb.log +1 -0
  13. data/examples/call/call_monitor.rb +55 -0
  14. data/examples/daemonize/daemonize.rb +20 -0
  15. data/examples/run/ctrl_crash.rb +17 -0
  16. data/examples/run/ctrl_exec.rb +16 -0
  17. data/examples/run/ctrl_exit.rb +15 -0
  18. data/examples/run/ctrl_keep_pid_files.rb +17 -0
  19. data/examples/run/ctrl_monitor.rb +16 -0
  20. data/examples/run/ctrl_multiple.rb +16 -0
  21. data/examples/run/ctrl_normal.rb +12 -0
  22. data/examples/run/ctrl_ontop.rb +16 -0
  23. data/examples/run/ctrl_optionparser.rb +43 -0
  24. data/examples/run/ctrl_proc.rb +25 -0
  25. data/examples/run/ctrl_proc.rb.output +101 -0
  26. data/examples/run/ctrl_proc_multiple.rb +22 -0
  27. data/examples/run/ctrl_proc_multiple.rb.output +2 -0
  28. data/examples/run/ctrl_proc_simple.rb +17 -0
  29. data/examples/run/myserver.rb +12 -0
  30. data/examples/run/myserver_crashing.rb +14 -0
  31. data/examples/run/myserver_crashing.rb.output +30 -0
  32. data/examples/run/myserver_exiting.rb +8 -0
  33. data/html/classes/Daemonize.html +497 -0
  34. data/html/classes/Daemons.html +683 -0
  35. data/html/classes/Daemons/Application.html +836 -0
  36. data/html/classes/Daemons/ApplicationGroup.html +508 -0
  37. data/html/classes/Daemons/CmdException.html +113 -0
  38. data/html/classes/Daemons/Controller.html +429 -0
  39. data/html/classes/Daemons/Error.html +113 -0
  40. data/html/classes/Daemons/Exception.html +111 -0
  41. data/html/classes/Daemons/Monitor.html +263 -0
  42. data/html/classes/Daemons/Optparse.html +244 -0
  43. data/html/classes/Daemons/Pid.html +339 -0
  44. data/html/classes/Daemons/PidFile.html +441 -0
  45. data/html/classes/Daemons/PidMem.html +126 -0
  46. data/html/classes/Daemons/RuntimeException.html +113 -0
  47. data/html/classes/Daemons/SystemError.html +163 -0
  48. data/html/created.rid +1 -0
  49. data/html/files/README.html +377 -0
  50. data/html/files/Releases.html +342 -0
  51. data/html/files/TODO.html +121 -0
  52. data/html/files/lib/daemons/application_group_rb.html +101 -0
  53. data/html/files/lib/daemons/application_rb.html +110 -0
  54. data/html/files/lib/daemons/cmdline_rb.html +101 -0
  55. data/html/files/lib/daemons/controller_rb.html +101 -0
  56. data/html/files/lib/daemons/daemonize_rb.html +207 -0
  57. data/html/files/lib/daemons/exceptions_rb.html +101 -0
  58. data/html/files/lib/daemons/monitor_rb.html +108 -0
  59. data/html/files/lib/daemons/pid_rb.html +108 -0
  60. data/html/files/lib/daemons/pidfile_rb.html +108 -0
  61. data/html/files/lib/daemons/pidmem_rb.html +108 -0
  62. data/html/files/lib/daemons_rb.html +117 -0
  63. data/html/fr_class_index.html +41 -0
  64. data/html/fr_file_index.html +40 -0
  65. data/html/fr_method_index.html +91 -0
  66. data/html/index.html +24 -0
  67. data/html/rdoc-style.css +208 -0
  68. data/lib/daemons.rb +284 -0
  69. data/lib/daemons/application.rb +376 -0
  70. data/lib/daemons/application_group.rb +152 -0
  71. data/lib/daemons/cmdline.rb +117 -0
  72. data/lib/daemons/controller.rb +137 -0
  73. data/lib/daemons/daemonize.rb +263 -0
  74. data/lib/daemons/exceptions.rb +28 -0
  75. data/lib/daemons/monitor.rb +136 -0
  76. data/lib/daemons/pid.rb +115 -0
  77. data/lib/daemons/pidfile.rb +111 -0
  78. data/lib/daemons/pidmem.rb +10 -0
  79. data/lib/daemons/version.rb +3 -0
  80. data/setup.rb +1360 -0
  81. data/test/call_as_daemon.rb +12 -0
  82. data/test/tc_main.rb +24 -0
  83. data/test/test1.rb +19 -0
  84. data/test/testapp.rb +11 -0
  85. metadata +170 -0
@@ -0,0 +1,342 @@
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 =&gt; 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 &#8216;KILL&#8217; instead of &#8216;TERM&#8217; on Windows
85
+ platforms.
86
+
87
+ </li>
88
+ <li>Use exit! in trap(&#8216;TERM&#8217;) 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 &#8216;0&#8217; (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 &#8217;/var/log&#8217; (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 &#8217;/var/log&#8217; 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 &#8216;ps ax&#8217;
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 &#8216;ps -ax&#8217; call back to &#8216;ps ax&#8217;.
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
+ &#8216;ruby ctrl_proc.rb run&#8217;), 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 &#8216;ps ax&#8217; 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 &#8216;ps ax&#8217; 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
+ &quot;&#8212;&quot;. (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 &#8216;run&#8217; command line mode: didn&#8216;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>(&quot;script.rb&quot;)</tt>)
253
+ </p>
254
+ </li>
255
+ <li>Improved documentation (for example &quot;How does the daemonization
256
+ process work?&quot;)
257
+
258
+ </li>
259
+ <li>Improved &quot;simulation mode&quot; (<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>&#8216;restart&#8217; command fixed
273
+
274
+ </li>
275
+ <li>&#8217;&#8212;force&#8217; 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 &#8216;status&#8217; 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>
@@ -0,0 +1,121 @@
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 &#8212;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>