win32-service 0.7.0-x86-mswin32-60 → 0.7.1-x86-mswin32-60
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +247 -238
- data/MANIFEST +18 -18
- data/README +74 -45
- data/Rakefile +139 -128
- data/doc/daemon.txt +157 -157
- data/doc/service.txt +365 -368
- data/examples/demo_daemon.rb +89 -89
- data/examples/demo_daemon_ctl.rb +122 -122
- data/examples/demo_services.rb +23 -23
- data/ext/win32/daemon.c +611 -596
- data/lib/win32/daemon.so +0 -0
- data/lib/win32/service.rb +1638 -1607
- data/test/test_win32_daemon.rb +58 -58
- data/test/test_win32_service.rb +409 -251
- data/test/test_win32_service_configure.rb +97 -86
- data/test/test_win32_service_create.rb +131 -103
- data/test/test_win32_service_info.rb +184 -179
- data/test/test_win32_service_status.rb +113 -111
- data/win32-service.gemspec +41 -49
- metadata +6 -6
data/CHANGES
CHANGED
@@ -1,238 +1,247 @@
|
|
1
|
-
== 0.7.
|
2
|
-
*
|
3
|
-
|
4
|
-
|
5
|
-
*
|
6
|
-
|
7
|
-
|
8
|
-
*
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
*
|
15
|
-
|
16
|
-
|
17
|
-
*
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
*
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
*
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
* The
|
40
|
-
|
41
|
-
|
42
|
-
* The
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
* The
|
49
|
-
|
50
|
-
*
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
*
|
62
|
-
*
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
*
|
70
|
-
|
71
|
-
*
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
*
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
* The
|
81
|
-
|
82
|
-
*
|
83
|
-
|
84
|
-
*
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
*
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
*
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
*
|
116
|
-
|
117
|
-
*
|
118
|
-
|
119
|
-
|
120
|
-
*
|
121
|
-
|
122
|
-
*
|
123
|
-
|
124
|
-
*
|
125
|
-
|
126
|
-
|
127
|
-
*
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
*
|
133
|
-
|
134
|
-
*
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
*
|
142
|
-
|
143
|
-
*
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
*
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
*
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
*
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
*
|
183
|
-
|
184
|
-
*
|
185
|
-
|
186
|
-
|
187
|
-
== 0.
|
188
|
-
*
|
189
|
-
|
190
|
-
|
191
|
-
*
|
192
|
-
|
193
|
-
*
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
*
|
206
|
-
in
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
*
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
*
|
221
|
-
|
222
|
-
for
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
*
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
*
|
236
|
-
|
237
|
-
|
238
|
-
|
1
|
+
== 0.7.1 - 9-Feb-2010
|
2
|
+
* Compatibility fixes for 1.9.x.
|
3
|
+
* Fixed a bug where the controls_accepted struct member was always nil. This
|
4
|
+
has been fixed and now always returns an array.
|
5
|
+
* Added 'pre-shutdown' as possible values for the list of controls accepted.
|
6
|
+
* Changed test-unit from a runtime dependency to a development dependency.
|
7
|
+
* Some tests were refactored to be more reliable.
|
8
|
+
* Refactored the Rakefile and gemspec.
|
9
|
+
|
10
|
+
== 0.7.0 - 30-Jun-2009
|
11
|
+
* INTERFACE CHANGE: The Service.new and Service.configure methods now accept
|
12
|
+
a single hash argument only. The :service_name key is mandatory, while the
|
13
|
+
:host key is optional.
|
14
|
+
* Fixed a bug in the Service.services method where a segfault would occur if
|
15
|
+
the binary_path_name was greater than 260 characters. The buffer size has
|
16
|
+
been increased to 1024 characters. Thanks go to Dan Daniels for the spot.
|
17
|
+
* Altered the Daemon class so that the Ruby interpreter was not invoked within
|
18
|
+
the Service_Main function. The functions that close stdin, stdout and stderr
|
19
|
+
are now called within the mainloop method. Thanks go to Tim Hanson for the
|
20
|
+
spot and the patch.
|
21
|
+
* Eliminated a minor build warning in daemon.c
|
22
|
+
* License changed to Artistic 2.0, with corresponding gemspec update.
|
23
|
+
* Added an uninstall rake task.
|
24
|
+
* Updated the service_stop method in the demo_daemon.rb file, and added some
|
25
|
+
additional comments.
|
26
|
+
* The test files were renamed.
|
27
|
+
* Several tests were updated and refactored to use Test::Unit 2.x. That
|
28
|
+
library is now a dependency.
|
29
|
+
* The 'uninstall' Rakefile task is now more verbose.
|
30
|
+
|
31
|
+
== 0.6.1 - 1-Jan-2008
|
32
|
+
* The Service.services method now handles the scenario where a particular
|
33
|
+
service may still exist, but its underlying registry entry has been deleted.
|
34
|
+
In this case, most ServiceInfo struct members are set to nil and a warning
|
35
|
+
is issued.
|
36
|
+
* RDoc updates.
|
37
|
+
|
38
|
+
== 0.6.0 - 25-Nov-2007
|
39
|
+
* The Service control class is now pure Ruby. The Daemon class is still C,
|
40
|
+
however. That may change in the future. This means the windows-pr
|
41
|
+
library is now a prerequisite.
|
42
|
+
* The Service.new method has been altered in a way that is not backwards
|
43
|
+
compatible. It is now the same as Service.create.
|
44
|
+
* The Service.start method now properly handles arguments to the
|
45
|
+
Daemon#service_main method.
|
46
|
+
* The Daemon source code is now separate from the Service control class
|
47
|
+
source code. That means you must require them separately, as needed.
|
48
|
+
* The Daemon class should be much more responsive to service events now,
|
49
|
+
especially service_stop. Many thanks go to Kevin Burge for the patch.
|
50
|
+
* Added the Daemon.mainloop method as a shortcut for Daemon.new.mainloop.
|
51
|
+
* The Daemon class now redirects STDIN, STDOUT and STDERR to the NUL device
|
52
|
+
if they're still associated with a terminal when the service starts. This
|
53
|
+
should help prevent Errno::EBADF errors.
|
54
|
+
* The Service.services class method now supports the group parameter for
|
55
|
+
versions of Ruby built with older compilers, i.e. it will now work with
|
56
|
+
the one-click Ruby installer.
|
57
|
+
* The Service.getdisplayname method was changed to Service.get_display_name.
|
58
|
+
An alias has been provided for backwards compatibility.
|
59
|
+
* The Service.getservicename method was changed to Service.get_service_name.
|
60
|
+
An alias has been provided for backwards compatibility.
|
61
|
+
* Added the Service.config_info method.
|
62
|
+
* The Service.create and Service.configure methods now allow you to set
|
63
|
+
failure actions, failure commands, and reset/retry periods.
|
64
|
+
* Improved test suite.
|
65
|
+
* Changed 'tdaemon.rb', 'tdaemon_ctl.rb' and 'service_test.rb' to
|
66
|
+
'demo_daemon.rb', 'demo_daemon_ctl.rb' and 'demo_services.rb', respectively.
|
67
|
+
* Some refactoring and updates to the demo daemon and demo daemon controller
|
68
|
+
examples.
|
69
|
+
* The Win32Service struct is now ServiceInfo.
|
70
|
+
* ServiceError is now Service::Error.
|
71
|
+
* DaemonError is now Daemon::Error.
|
72
|
+
* Some documentation improvements, corrections and updates.
|
73
|
+
|
74
|
+
== 0.5.2 - 25-Nov-2006
|
75
|
+
* Fixed a bug in the Daemon class where the service event handling methods
|
76
|
+
(most notably service_stop) did not work properly due to thread blocking
|
77
|
+
issues. Many thanks go to Patrick Hurley for the patch.
|
78
|
+
* Added the Daemon#running? method as helper method for your service_main
|
79
|
+
method.
|
80
|
+
* The 'interactive?' struct member is now just 'interactive'. This was
|
81
|
+
supposed to have been in the last release but was somehow missed. Sorry.
|
82
|
+
* Scrapped the old daemon_test.rb file and split it into two new files -
|
83
|
+
tdaemon.rb and tdaemon_ctl.rb. In the process a few bugs were fixed.
|
84
|
+
* Added a gemspec.
|
85
|
+
* Documentation and test suite updates.
|
86
|
+
|
87
|
+
== 0.5.1 - 18-Jun-2006
|
88
|
+
* Added the Service.open method.
|
89
|
+
* The Service.new method now accepts a block, and automatically closes itself
|
90
|
+
at the end of the block.
|
91
|
+
* Fixed in a bug in the Service.create method where setting dependencies
|
92
|
+
was not working properly. Thanks go to Scott Harper for the spot.
|
93
|
+
* The 'interactive?' struct member is now just 'interactive' since Ruby no
|
94
|
+
longer supports question marks in struct member names. UGH.
|
95
|
+
* The block for Service#configure_service is no longer optional.
|
96
|
+
* Replaced ClipSrv with W32Time for most of the test methods in tc_service.rb
|
97
|
+
because it had a dependency that is disabled on most systems.
|
98
|
+
* Added a tweak to the extconf.rb file to help with the test suite.
|
99
|
+
* Some documentation updates and corrections.
|
100
|
+
|
101
|
+
== 0.5.0 - 26-Nov-2005
|
102
|
+
* Added a service_init hook, and (internally) altered the way the service
|
103
|
+
starts. This was done to deal with services that need to perform any
|
104
|
+
initialization in the Daemon itself before the service starts. Previously
|
105
|
+
this would result in the service timing out during startup.
|
106
|
+
|
107
|
+
Thanks go to Jamey Cribbs for spotting the problem.
|
108
|
+
|
109
|
+
* Modified the Daemon example, adding a service_init hook that does about 10
|
110
|
+
seconds worth of initialization before finally starting. See the comments
|
111
|
+
in examples\daemon_test.rb for more information.
|
112
|
+
* Minor test and README changes.
|
113
|
+
|
114
|
+
== 0.4.6 - 24-May-2005
|
115
|
+
* Fixed an initialization bug that could cause Daemons to fail unless the
|
116
|
+
win32-service package was the last package require'd.
|
117
|
+
* Altered the Service.start method. It now takes any number of arguments
|
118
|
+
(after the service and host name). These arguments are passed to the
|
119
|
+
service's Service_Main() function.
|
120
|
+
* The Service.services method now returns an Array of ServiceStruct's in
|
121
|
+
non-block form.
|
122
|
+
* The Service.start, Service.pause, Service.resume, Service.stop and
|
123
|
+
Service.delete methods now return the class (self), not 'true'.
|
124
|
+
* Added the ability to add or configure the service description in
|
125
|
+
Service#create_service or Service#configure, respectively.
|
126
|
+
* Fixed a bug in the Service.start method where false positives could result.
|
127
|
+
* Updated the ServiceStatus struct to include pid and service_flags on Win2k
|
128
|
+
or later.
|
129
|
+
* Unicode is now the default setting as far as internal string handling. It
|
130
|
+
will still work fine with 'regular' text.
|
131
|
+
* Added safe string handling for string input values.
|
132
|
+
* Added rdoc comments into the C source.
|
133
|
+
* Made the service.txt and daemon.txt files rdoc friendly.
|
134
|
+
* Removed the service.rd and daemon.rd files. If you want html documentation,
|
135
|
+
run rdoc over the service.txt and daemon.txt files.
|
136
|
+
* The dreaded "code cleanup".
|
137
|
+
|
138
|
+
== 0.4.5 - 28-Feb-2005
|
139
|
+
* Fixed an accessor bug in Service#create. Thanks go to Nathaniel Talbott
|
140
|
+
for the spot.
|
141
|
+
* Eliminated a warning that appeared starting in Ruby 1.8.2 regarding Struct
|
142
|
+
redefinitions.
|
143
|
+
* Moved 'examples' directory to toplevel directory.
|
144
|
+
* Deleted the 'test2.rb' example. This was supplanted by the 'daemon_test.rb'
|
145
|
+
script.
|
146
|
+
* Renamed the 'test.rb' file to 'services_test.rb'.
|
147
|
+
* Made this document rdoc friendly.
|
148
|
+
|
149
|
+
== 0.4.4 - 27-Aug-2004
|
150
|
+
* Modified the Service class to use the newer allocation framework. The
|
151
|
+
Daemon class already used this, hence no major version bump.
|
152
|
+
* Fixed in a bug in the create_service() method with regards to the
|
153
|
+
'dependencies' option and null arguments (you no longer need to specify
|
154
|
+
an empty array).
|
155
|
+
|
156
|
+
== 0.4.3 - 14-Aug-2004
|
157
|
+
* Fixed the Daemon class by adding back the constants it needed in order to
|
158
|
+
run. I accidentally broke this when I changed the Daemon class from being
|
159
|
+
a subclass of Service to being its own class.
|
160
|
+
* Added a separate test suite for the Daemon class, tc_daemon.rb, to help
|
161
|
+
me from making that mistake ever again. :)
|
162
|
+
* Updated the daemon_test.rb script a bit to report error messages should
|
163
|
+
any occur.
|
164
|
+
* Minor doc updates
|
165
|
+
|
166
|
+
== 0.4.2 - 10-Jul-2004
|
167
|
+
* The Daemon class is no longer a subclass of Service.
|
168
|
+
* Added the 'pid' and 'service_flags' struct members to the Win32Service
|
169
|
+
struct. These members are only available to folks using Windows 2000 or
|
170
|
+
later and who compile with VC++ 7.0 or later (including the .NET SDK).
|
171
|
+
* The Service.services method now accepts a group name as an optional third
|
172
|
+
argument. Again, you must be using Windows 2000 or later and compile with
|
173
|
+
VC++ 7.0 or later (including the .NET SDK).
|
174
|
+
* The deprecated STR2CSTR() functions were replaced with StringValuePtr().
|
175
|
+
This also means that as of this version, win32-service requires Ruby
|
176
|
+
1.8.0 or greater.
|
177
|
+
* Moved the sample programs to doc/examples
|
178
|
+
* Removed the .html files under /doc. You can generate that on your own if
|
179
|
+
you like.
|
180
|
+
|
181
|
+
== 0.4.1 - 14-Mar-2004
|
182
|
+
* Added the exists? class method and corresponding test suite additions.
|
183
|
+
* Pushed the ServiceError and DaemonError classes under the Win32 module.
|
184
|
+
* Normalized tc_service.rb so that it can be run outside of the test directory
|
185
|
+
more easily.
|
186
|
+
|
187
|
+
== 0.4.0 - 9-Feb-2004
|
188
|
+
* Changed "worker" method to "service_main" method.
|
189
|
+
* Added event hooks for stop, pause, resume, etc. See the documentation for
|
190
|
+
further details. (Thanks Park Heesob)
|
191
|
+
* Some of the Daemon functions were raising ServiceError. They have been
|
192
|
+
changed to DaemonError.
|
193
|
+
* Updated the daemon_test.rb file to use the new event hooks.
|
194
|
+
* Documentation additions and updates.
|
195
|
+
|
196
|
+
== 0.3.0 - 31-Jan-2004
|
197
|
+
* Added a Daemon subclass. This allows you to run Ruby programs as a service.
|
198
|
+
Please see the documentation for more details. (Thanks Park Heesob). This
|
199
|
+
should be considered an ALPHA release.
|
200
|
+
* The Win32ServiceError class has been renamed to just ServiceError. I felt
|
201
|
+
the "Win32" was redundant, given that it's already under the Win32 module.
|
202
|
+
* In some cases a bogus error description was being returned because the
|
203
|
+
GetLastError() function was being called too late. This has been fixed.
|
204
|
+
(Thanks Park Heesob).
|
205
|
+
* The explicit garbage collection has been removed because what I thought was
|
206
|
+
a memory leak was not, in fact, a memory leak. In addition, it was hurting
|
207
|
+
performance badly.
|
208
|
+
* The "\r\n" is now automatically stripped from error messages. This was
|
209
|
+
causing slightly garbled error messages. (Thanks Park Heesob).
|
210
|
+
* Added explicit closing of the Service Control Manager handle in the
|
211
|
+
services() function for those rare cases where it may fail while reading
|
212
|
+
service information.
|
213
|
+
* Made some of the error strings a bit more descriptive.
|
214
|
+
* Test suite and documentation additions, including a sample daemon program
|
215
|
+
in the test directory called "daemon_test.rb".
|
216
|
+
|
217
|
+
== 0.2.2 - 15-Jan-2004
|
218
|
+
* Fixed a mistake in the service_init declaration within Init_service().
|
219
|
+
* Fixed bug in the service_init function with regards to desired access.
|
220
|
+
* Modified service_free() function to explicitly set the hSCManager handle
|
221
|
+
to NULL and modified the service_close() method to test hSCManager handle
|
222
|
+
for NULL value. This should eliminate accidentally trying to close an
|
223
|
+
already closed handle, which may have happened as the result of a free()
|
224
|
+
call. (Thanks Park Heesob).
|
225
|
+
* Added explicit garbage collection in Service.services() method.
|
226
|
+
* More explicit about closing open HANDLE's when error conditions arise.
|
227
|
+
|
228
|
+
== 0.2.1 - 2-Nov-2003
|
229
|
+
* Made the exported less redundant and less verbose, e.g.
|
230
|
+
Service::SERVICE_DISABLED is now just Service::DISABLED. The same is true
|
231
|
+
for the service control constants, i.e. the 'SC_' has been removed.
|
232
|
+
* Corresponding test suite changes.
|
233
|
+
|
234
|
+
== 0.2.0 - 16-Oct-2003
|
235
|
+
* The constructor has been changed. It now only takes a machine name and a
|
236
|
+
desired access for arguments. The keyword arguments are now part of the
|
237
|
+
create_service method() and only in block form. See the documentation for
|
238
|
+
more details.
|
239
|
+
* Added a configure_service() and close() instance methods.
|
240
|
+
* Added several new constants to allow finer control over created and
|
241
|
+
configured services.
|
242
|
+
* Added Win32ServiceError as an exception. All failures now raise this
|
243
|
+
error instead of a vanilla StandardError.
|
244
|
+
* Moved some common code into the service.h file.
|
245
|
+
|
246
|
+
== 0.1.0 - 10-Oct-2003
|
247
|
+
- Initial release
|