launch 1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +12 -0
- data/LICENSE +19 -0
- data/README.md +65 -0
- data/ext/extconf.rb +17 -0
- data/ext/launch.c +272 -0
- data/lib/launch.bundle +0 -0
- data/lib/launch.rb +7 -80
- data/lib/launch/errors.rb +22 -0
- data/lib/launch/job.rb +170 -0
- data/lib/launch/test_helper.rb +11 -0
- data/lib/launch/version.rb +3 -0
- data/lib/launch/webrick.rb +21 -27
- data/test/launch/job_test.rb +9 -0
- data/test/launch/service_test.rb +23 -0
- data/test/launch_test.rb +11 -0
- metadata +55 -135
- data.tar.gz.sig +0 -1
- data/.autotest +0 -8
- data/.gemtest +0 -0
- data/History.txt +0 -5
- data/Manifest.txt +0 -11
- data/README.txt +0 -72
- data/Rakefile +0 -37
- data/ext/launch/extconf.rb +0 -6
- data/ext/launch/launch.c +0 -355
- data/sample/echo.rb +0 -107
- data/test/test_launch.rb +0 -55
- metadata.gz.sig +0 -2
data.tar.gz.sig
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
d�(4�äQIm�v��H�������Pp6f��#��P�Ob�JњL��.t�K2>���;��j��[�<v�I?7v���̸$D{C<���&7۲���L��M[WO�� �����ԋkU�)X^)?SƋ��6s'K,ǝ�o~D�ub��PN}�l���(�]/��7��t�|vy�Yr��3N��:����)�H}�������;dS��a���ǵ���?�r`'��s`@�un�+��A}b����J|%[�U
|
data/.autotest
DELETED
data/.gemtest
DELETED
File without changes
|
data/History.txt
DELETED
data/Manifest.txt
DELETED
data/README.txt
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
= launch
|
2
|
-
|
3
|
-
* https://github.com/drbrain/launch
|
4
|
-
* http://docs.seattlerb.org/launch
|
5
|
-
|
6
|
-
== DESCRIPTION:
|
7
|
-
|
8
|
-
Launch allows agents and daemons launched by launchd to retrieve their list of
|
9
|
-
sockets. Launchd is an open source framework for launching and managing
|
10
|
-
daemons, programs and scripts provided by Apple.
|
11
|
-
|
12
|
-
== FEATURES/PROBLEMS:
|
13
|
-
|
14
|
-
* Provides the Launch module for easy integration with existing programs
|
15
|
-
* Allows on-demand execution of ruby programs through launchd
|
16
|
-
|
17
|
-
== SYNOPSIS:
|
18
|
-
|
19
|
-
require 'launch'
|
20
|
-
|
21
|
-
class MyDaemon
|
22
|
-
def initialize
|
23
|
-
launch_checkin
|
24
|
-
launch_sockets('MyDaemonSocket', TCPServer).each do |server|
|
25
|
-
# handle requests, see sample/echo.rb
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
MyDaemon.new
|
31
|
-
|
32
|
-
== REQUIREMENTS:
|
33
|
-
|
34
|
-
* An installed launchd
|
35
|
-
|
36
|
-
== INSTALL:
|
37
|
-
|
38
|
-
gem install launch
|
39
|
-
|
40
|
-
== DEVELOPERS:
|
41
|
-
|
42
|
-
After checking out the source, run:
|
43
|
-
|
44
|
-
$ rake newb
|
45
|
-
|
46
|
-
This task will install any missing dependencies, run the tests/specs,
|
47
|
-
and generate the RDoc.
|
48
|
-
|
49
|
-
== LICENSE:
|
50
|
-
|
51
|
-
(The MIT License)
|
52
|
-
|
53
|
-
Copyright (c) 2011 Eric Hodel
|
54
|
-
|
55
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
56
|
-
a copy of this software and associated documentation files (the
|
57
|
-
'Software'), to deal in the Software without restriction, including
|
58
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
59
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
60
|
-
permit persons to whom the Software is furnished to do so, subject to
|
61
|
-
the following conditions:
|
62
|
-
|
63
|
-
The above copyright notice and this permission notice shall be
|
64
|
-
included in all copies or substantial portions of the Software.
|
65
|
-
|
66
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
67
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
68
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
69
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
70
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
71
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
72
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# -*- ruby -*-
|
2
|
-
|
3
|
-
task :default => :compile
|
4
|
-
|
5
|
-
require 'rubygems'
|
6
|
-
require 'hoe'
|
7
|
-
|
8
|
-
Hoe.plugin :minitest
|
9
|
-
Hoe.plugin :git
|
10
|
-
|
11
|
-
hoe = Hoe.spec 'launch' do
|
12
|
-
developer 'Eric Hodel', 'drbrain@segment7.net'
|
13
|
-
|
14
|
-
rdoc_locations << 'docs.seattlerb.org:/data/www/docs.seattlerb.org/launch/'
|
15
|
-
|
16
|
-
extra_dev_deps << ['rake-compiler', '~> 0.7']
|
17
|
-
self.spec_extras[:extensions] = %w[ext/launch/extconf.rb]
|
18
|
-
|
19
|
-
self.spec_extras[:required_ruby_version] = '>= 1.9.2'
|
20
|
-
|
21
|
-
self.clean_globs = %[
|
22
|
-
lib/launch/launch.bundle
|
23
|
-
]
|
24
|
-
end
|
25
|
-
|
26
|
-
begin
|
27
|
-
gem 'rake-compiler', '~> 0.7'
|
28
|
-
require 'rake/extensiontask'
|
29
|
-
|
30
|
-
Rake::ExtensionTask.new hoe.name, hoe.spec do |ext|
|
31
|
-
ext.lib_dir = File.join 'lib', 'launch'
|
32
|
-
end
|
33
|
-
rescue Gem::LoadError
|
34
|
-
warn 'You need to rake newb'
|
35
|
-
end
|
36
|
-
|
37
|
-
# vim: syntax=ruby
|
data/ext/launch/extconf.rb
DELETED
data/ext/launch/launch.c
DELETED
@@ -1,355 +0,0 @@
|
|
1
|
-
#include <ruby.h>
|
2
|
-
#include <launch.h>
|
3
|
-
#include <errno.h>
|
4
|
-
#include <stdio.h>
|
5
|
-
|
6
|
-
VALUE mLaunch;
|
7
|
-
VALUE mLaunchKey;
|
8
|
-
VALUE mLaunchJobKey;
|
9
|
-
VALUE mLaunchSocket;
|
10
|
-
VALUE mLaunchJobPolicy;
|
11
|
-
VALUE mLaunchData;
|
12
|
-
VALUE cLaunchError;
|
13
|
-
|
14
|
-
static VALUE launch_data_to_ruby(launch_data_t);
|
15
|
-
|
16
|
-
static void
|
17
|
-
launch_dict_iterator(launch_data_t item, const char * key, void * hash) {
|
18
|
-
rb_hash_aset((VALUE)hash, rb_str_new2(key), launch_data_to_ruby(item));
|
19
|
-
}
|
20
|
-
|
21
|
-
static VALUE
|
22
|
-
launch_data_to_ruby(launch_data_t item) {
|
23
|
-
VALUE out = Qnil;
|
24
|
-
launch_data_t temp = NULL;
|
25
|
-
launch_data_type_t item_type = launch_data_get_type(item);
|
26
|
-
int i = 0;
|
27
|
-
size_t length = 0;
|
28
|
-
|
29
|
-
switch(item_type) {
|
30
|
-
case LAUNCH_DATA_DICTIONARY:
|
31
|
-
out = rb_hash_new();
|
32
|
-
|
33
|
-
launch_data_dict_iterate(item, launch_dict_iterator, (void *)out);
|
34
|
-
|
35
|
-
break;
|
36
|
-
case LAUNCH_DATA_ARRAY:
|
37
|
-
length = launch_data_array_get_count(item);
|
38
|
-
out = rb_ary_new2(length);
|
39
|
-
|
40
|
-
for (i = 0; i < length; i++) {
|
41
|
-
temp = launch_data_array_get_index(item, i);
|
42
|
-
rb_ary_store(out, i, launch_data_to_ruby(temp));
|
43
|
-
}
|
44
|
-
|
45
|
-
break;
|
46
|
-
case LAUNCH_DATA_FD:
|
47
|
-
out = INT2NUM(launch_data_get_fd(item));
|
48
|
-
break;
|
49
|
-
case LAUNCH_DATA_INTEGER:
|
50
|
-
out = LONG2NUM(launch_data_get_integer(item));
|
51
|
-
break;
|
52
|
-
case LAUNCH_DATA_REAL:
|
53
|
-
out = DBL2NUM(launch_data_get_real(item));
|
54
|
-
break;
|
55
|
-
case LAUNCH_DATA_BOOL:
|
56
|
-
out = launch_data_get_bool(item) == TRUE ? Qtrue : Qfalse;
|
57
|
-
break;
|
58
|
-
case LAUNCH_DATA_STRING:
|
59
|
-
out = rb_str_new2(launch_data_get_string(item));
|
60
|
-
break;
|
61
|
-
case LAUNCH_DATA_OPAQUE:
|
62
|
-
out = rb_str_new(launch_data_get_opaque(item),
|
63
|
-
launch_data_get_opaque_size(item));
|
64
|
-
break;
|
65
|
-
case LAUNCH_DATA_ERRNO:
|
66
|
-
out = INT2NUM(launch_data_get_errno(item));
|
67
|
-
break;
|
68
|
-
case LAUNCH_DATA_MACHPORT:
|
69
|
-
break;
|
70
|
-
default:
|
71
|
-
rb_raise(cLaunchError, "unknown item type %d", item_type);
|
72
|
-
}
|
73
|
-
|
74
|
-
return out;
|
75
|
-
}
|
76
|
-
|
77
|
-
/*
|
78
|
-
* call-seq:
|
79
|
-
* launch_message(Launch::Key::CHECKIN) # => response
|
80
|
-
*
|
81
|
-
* launch_message wraps launch(3)'s launch_msg function. The argument is a
|
82
|
-
* message to send launchd from Launch::Key. Please use launch_checkin
|
83
|
-
* and launch_sockets instead of this method.
|
84
|
-
*
|
85
|
-
* The response from launchd is converted to a ruby structure and freed
|
86
|
-
* (usually a Hash). Currently the following data types in the response are
|
87
|
-
* indistinguishable in the ruby structure:
|
88
|
-
*
|
89
|
-
* * STRING and OPAQUE
|
90
|
-
* * INTEGER, FD and ERRNO
|
91
|
-
*
|
92
|
-
* Additionally, MACHPORT is ignored.
|
93
|
-
*
|
94
|
-
* If there was a failure to retrieve checkin data an error will be raised.
|
95
|
-
*/
|
96
|
-
static VALUE
|
97
|
-
message(VALUE self, VALUE message) {
|
98
|
-
VALUE out, tmp;
|
99
|
-
launch_data_t send, response;
|
100
|
-
launch_data_type_t response_type;
|
101
|
-
|
102
|
-
message = rb_str_to_str(message);
|
103
|
-
|
104
|
-
send = launch_data_new_string(StringValueCStr(message));
|
105
|
-
|
106
|
-
if (send == NULL) {
|
107
|
-
tmp = rb_inspect(message);
|
108
|
-
rb_raise(cLaunchError, "unable to create message %s",
|
109
|
-
StringValueCStr(tmp));
|
110
|
-
}
|
111
|
-
|
112
|
-
response = launch_msg(send);
|
113
|
-
|
114
|
-
if (response == NULL)
|
115
|
-
rb_sys_fail("launch_msg");
|
116
|
-
|
117
|
-
response_type = launch_data_get_type(response);
|
118
|
-
|
119
|
-
if (response_type == LAUNCH_DATA_ERRNO) {
|
120
|
-
errno = launch_data_get_errno(response);
|
121
|
-
rb_sys_fail("launch_msg");
|
122
|
-
}
|
123
|
-
|
124
|
-
out = launch_data_to_ruby(response);
|
125
|
-
|
126
|
-
launch_data_free(response);
|
127
|
-
|
128
|
-
return out;
|
129
|
-
}
|
130
|
-
|
131
|
-
void
|
132
|
-
Init_launch() {
|
133
|
-
mLaunch = rb_define_module("Launch");
|
134
|
-
cLaunchError = rb_define_class_under(mLaunch, "Error", rb_eRuntimeError);
|
135
|
-
|
136
|
-
rb_define_method(mLaunch, "launch_message", message, 1);
|
137
|
-
|
138
|
-
rb_const_set(mLaunch, rb_intern("JOBINETDCOMPATIBILITY_WAIT"),
|
139
|
-
rb_str_new2(LAUNCH_JOBINETDCOMPATIBILITY_WAIT));
|
140
|
-
|
141
|
-
/*
|
142
|
-
* Launch::Key holds launch message types
|
143
|
-
*/
|
144
|
-
mLaunchKey = rb_define_module_under(mLaunch, "Key");
|
145
|
-
rb_const_set(mLaunchKey, rb_intern("SUBMITJOB"),
|
146
|
-
rb_str_new2(LAUNCH_KEY_SUBMITJOB));
|
147
|
-
rb_const_set(mLaunchKey, rb_intern("REMOVEJOB"),
|
148
|
-
rb_str_new2(LAUNCH_KEY_REMOVEJOB));
|
149
|
-
rb_const_set(mLaunchKey, rb_intern("STARTJOB"),
|
150
|
-
rb_str_new2(LAUNCH_KEY_STARTJOB));
|
151
|
-
rb_const_set(mLaunchKey, rb_intern("STOPJOB"),
|
152
|
-
rb_str_new2(LAUNCH_KEY_STOPJOB));
|
153
|
-
rb_const_set(mLaunchKey, rb_intern("GETJOB"),
|
154
|
-
rb_str_new2(LAUNCH_KEY_GETJOB));
|
155
|
-
rb_const_set(mLaunchKey, rb_intern("GETJOBS"),
|
156
|
-
rb_str_new2(LAUNCH_KEY_GETJOBS));
|
157
|
-
rb_const_set(mLaunchKey, rb_intern("CHECKIN"),
|
158
|
-
rb_str_new2(LAUNCH_KEY_CHECKIN));
|
159
|
-
|
160
|
-
/*
|
161
|
-
* Launch::JobKey holds various keys returned in a message response
|
162
|
-
*/
|
163
|
-
mLaunchJobKey = rb_define_module_under(mLaunch, "JobKey");
|
164
|
-
rb_const_set(mLaunchJobKey, rb_intern("LABEL"),
|
165
|
-
rb_str_new2(LAUNCH_JOBKEY_LABEL));
|
166
|
-
rb_const_set(mLaunchJobKey, rb_intern("DISABLED"),
|
167
|
-
rb_str_new2(LAUNCH_JOBKEY_DISABLED));
|
168
|
-
rb_const_set(mLaunchJobKey, rb_intern("USERNAME"),
|
169
|
-
rb_str_new2(LAUNCH_JOBKEY_USERNAME));
|
170
|
-
rb_const_set(mLaunchJobKey, rb_intern("GROUPNAME"),
|
171
|
-
rb_str_new2(LAUNCH_JOBKEY_GROUPNAME));
|
172
|
-
rb_const_set(mLaunchJobKey, rb_intern("TIMEOUT"),
|
173
|
-
rb_str_new2(LAUNCH_JOBKEY_TIMEOUT));
|
174
|
-
rb_const_set(mLaunchJobKey, rb_intern("EXITTIMEOUT"),
|
175
|
-
rb_str_new2(LAUNCH_JOBKEY_EXITTIMEOUT));
|
176
|
-
rb_const_set(mLaunchJobKey, rb_intern("INITGROUPS"),
|
177
|
-
rb_str_new2(LAUNCH_JOBKEY_INITGROUPS));
|
178
|
-
rb_const_set(mLaunchJobKey, rb_intern("SOCKETS"),
|
179
|
-
rb_str_new2(LAUNCH_JOBKEY_SOCKETS));
|
180
|
-
rb_const_set(mLaunchJobKey, rb_intern("MACHSERVICES"),
|
181
|
-
rb_str_new2(LAUNCH_JOBKEY_MACHSERVICES));
|
182
|
-
rb_const_set(mLaunchJobKey, rb_intern("MACHSERVICELOOKUPPOLICIES"),
|
183
|
-
rb_str_new2(LAUNCH_JOBKEY_MACHSERVICELOOKUPPOLICIES));
|
184
|
-
rb_const_set(mLaunchJobKey, rb_intern("INETDCOMPATIBILITY"),
|
185
|
-
rb_str_new2(LAUNCH_JOBKEY_INETDCOMPATIBILITY));
|
186
|
-
rb_const_set(mLaunchJobKey, rb_intern("ENABLEGLOBBING"),
|
187
|
-
rb_str_new2(LAUNCH_JOBKEY_ENABLEGLOBBING));
|
188
|
-
rb_const_set(mLaunchJobKey, rb_intern("PROGRAMARGUMENTS"),
|
189
|
-
rb_str_new2(LAUNCH_JOBKEY_PROGRAMARGUMENTS));
|
190
|
-
rb_const_set(mLaunchJobKey, rb_intern("PROGRAM"),
|
191
|
-
rb_str_new2(LAUNCH_JOBKEY_PROGRAM));
|
192
|
-
rb_const_set(mLaunchJobKey, rb_intern("ONDEMAND"),
|
193
|
-
rb_str_new2(LAUNCH_JOBKEY_ONDEMAND));
|
194
|
-
rb_const_set(mLaunchJobKey, rb_intern("KEEPALIVE"),
|
195
|
-
rb_str_new2(LAUNCH_JOBKEY_KEEPALIVE));
|
196
|
-
rb_const_set(mLaunchJobKey, rb_intern("LIMITLOADTOHOSTS"),
|
197
|
-
rb_str_new2(LAUNCH_JOBKEY_LIMITLOADTOHOSTS));
|
198
|
-
rb_const_set(mLaunchJobKey, rb_intern("LIMITLOADFROMHOSTS"),
|
199
|
-
rb_str_new2(LAUNCH_JOBKEY_LIMITLOADFROMHOSTS));
|
200
|
-
rb_const_set(mLaunchJobKey, rb_intern("LIMITLOADTOSESSIONTYPE"),
|
201
|
-
rb_str_new2(LAUNCH_JOBKEY_LIMITLOADTOSESSIONTYPE));
|
202
|
-
rb_const_set(mLaunchJobKey, rb_intern("RUNATLOAD"),
|
203
|
-
rb_str_new2(LAUNCH_JOBKEY_RUNATLOAD));
|
204
|
-
rb_const_set(mLaunchJobKey, rb_intern("ROOTDIRECTORY"),
|
205
|
-
rb_str_new2(LAUNCH_JOBKEY_ROOTDIRECTORY));
|
206
|
-
rb_const_set(mLaunchJobKey, rb_intern("WORKINGDIRECTORY"),
|
207
|
-
rb_str_new2(LAUNCH_JOBKEY_WORKINGDIRECTORY));
|
208
|
-
rb_const_set(mLaunchJobKey, rb_intern("ENVIRONMENTVARIABLES"),
|
209
|
-
rb_str_new2(LAUNCH_JOBKEY_ENVIRONMENTVARIABLES));
|
210
|
-
rb_const_set(mLaunchJobKey, rb_intern("USERENVIRONMENTVARIABLES"),
|
211
|
-
rb_str_new2(LAUNCH_JOBKEY_USERENVIRONMENTVARIABLES));
|
212
|
-
rb_const_set(mLaunchJobKey, rb_intern("UMASK"),
|
213
|
-
rb_str_new2(LAUNCH_JOBKEY_UMASK));
|
214
|
-
rb_const_set(mLaunchJobKey, rb_intern("NICE"),
|
215
|
-
rb_str_new2(LAUNCH_JOBKEY_NICE));
|
216
|
-
rb_const_set(mLaunchJobKey, rb_intern("HOPEFULLYEXITSFIRST"),
|
217
|
-
rb_str_new2(LAUNCH_JOBKEY_HOPEFULLYEXITSFIRST));
|
218
|
-
rb_const_set(mLaunchJobKey, rb_intern("HOPEFULLYEXITSLAST"),
|
219
|
-
rb_str_new2(LAUNCH_JOBKEY_HOPEFULLYEXITSLAST));
|
220
|
-
rb_const_set(mLaunchJobKey, rb_intern("LOWPRIORITYIO"),
|
221
|
-
rb_str_new2(LAUNCH_JOBKEY_LOWPRIORITYIO));
|
222
|
-
rb_const_set(mLaunchJobKey, rb_intern("SESSIONCREATE"),
|
223
|
-
rb_str_new2(LAUNCH_JOBKEY_SESSIONCREATE));
|
224
|
-
rb_const_set(mLaunchJobKey, rb_intern("STARTONMOUNT"),
|
225
|
-
rb_str_new2(LAUNCH_JOBKEY_STARTONMOUNT));
|
226
|
-
rb_const_set(mLaunchJobKey, rb_intern("SOFTRESOURCELIMITS"),
|
227
|
-
rb_str_new2(LAUNCH_JOBKEY_SOFTRESOURCELIMITS));
|
228
|
-
rb_const_set(mLaunchJobKey, rb_intern("HARDRESOURCELIMITS"),
|
229
|
-
rb_str_new2(LAUNCH_JOBKEY_HARDRESOURCELIMITS));
|
230
|
-
rb_const_set(mLaunchJobKey, rb_intern("STANDARDINPATH"),
|
231
|
-
rb_str_new2(LAUNCH_JOBKEY_STANDARDINPATH));
|
232
|
-
rb_const_set(mLaunchJobKey, rb_intern("STANDARDOUTPATH"),
|
233
|
-
rb_str_new2(LAUNCH_JOBKEY_STANDARDOUTPATH));
|
234
|
-
rb_const_set(mLaunchJobKey, rb_intern("STANDARDERRORPATH"),
|
235
|
-
rb_str_new2(LAUNCH_JOBKEY_STANDARDERRORPATH));
|
236
|
-
rb_const_set(mLaunchJobKey, rb_intern("DEBUG"),
|
237
|
-
rb_str_new2(LAUNCH_JOBKEY_DEBUG));
|
238
|
-
rb_const_set(mLaunchJobKey, rb_intern("WAITFORDEBUGGER"),
|
239
|
-
rb_str_new2(LAUNCH_JOBKEY_WAITFORDEBUGGER));
|
240
|
-
rb_const_set(mLaunchJobKey, rb_intern("QUEUEDIRECTORIES"),
|
241
|
-
rb_str_new2(LAUNCH_JOBKEY_QUEUEDIRECTORIES));
|
242
|
-
rb_const_set(mLaunchJobKey, rb_intern("WATCHPATHS"),
|
243
|
-
rb_str_new2(LAUNCH_JOBKEY_WATCHPATHS));
|
244
|
-
rb_const_set(mLaunchJobKey, rb_intern("STARTINTERVAL"),
|
245
|
-
rb_str_new2(LAUNCH_JOBKEY_STARTINTERVAL));
|
246
|
-
rb_const_set(mLaunchJobKey, rb_intern("STARTCALENDARINTERVAL"),
|
247
|
-
rb_str_new2(LAUNCH_JOBKEY_STARTCALENDARINTERVAL));
|
248
|
-
rb_const_set(mLaunchJobKey, rb_intern("BONJOURFDS"),
|
249
|
-
rb_str_new2(LAUNCH_JOBKEY_BONJOURFDS));
|
250
|
-
rb_const_set(mLaunchJobKey, rb_intern("LASTEXITSTATUS"),
|
251
|
-
rb_str_new2(LAUNCH_JOBKEY_LASTEXITSTATUS));
|
252
|
-
rb_const_set(mLaunchJobKey, rb_intern("PID"),
|
253
|
-
rb_str_new2(LAUNCH_JOBKEY_PID));
|
254
|
-
rb_const_set(mLaunchJobKey, rb_intern("THROTTLEINTERVAL"),
|
255
|
-
rb_str_new2(LAUNCH_JOBKEY_THROTTLEINTERVAL));
|
256
|
-
rb_const_set(mLaunchJobKey, rb_intern("LAUNCHONLYONCE"),
|
257
|
-
rb_str_new2(LAUNCH_JOBKEY_LAUNCHONLYONCE));
|
258
|
-
rb_const_set(mLaunchJobKey, rb_intern("ABANDONPROCESSGROUP"),
|
259
|
-
rb_str_new2(LAUNCH_JOBKEY_ABANDONPROCESSGROUP));
|
260
|
-
rb_const_set(mLaunchJobKey, rb_intern("IGNOREPROCESSGROUPATSHUTDOWN"),
|
261
|
-
rb_str_new2(LAUNCH_JOBKEY_IGNOREPROCESSGROUPATSHUTDOWN));
|
262
|
-
rb_const_set(mLaunchJobKey, rb_intern("POLICIES"),
|
263
|
-
rb_str_new2(LAUNCH_JOBKEY_POLICIES));
|
264
|
-
rb_const_set(mLaunchJobKey, rb_intern("ENABLETRANSACTIONS"),
|
265
|
-
rb_str_new2(LAUNCH_JOBKEY_ENABLETRANSACTIONS));
|
266
|
-
|
267
|
-
rb_const_set(mLaunchJobKey, rb_intern("MACH_RESETATCLOSE"),
|
268
|
-
rb_str_new2(LAUNCH_JOBKEY_MACH_RESETATCLOSE));
|
269
|
-
rb_const_set(mLaunchJobKey, rb_intern("MACH_HIDEUNTILCHECKIN"),
|
270
|
-
rb_str_new2(LAUNCH_JOBKEY_MACH_HIDEUNTILCHECKIN));
|
271
|
-
rb_const_set(mLaunchJobKey, rb_intern("MACH_DRAINMESSAGESONCRASH"),
|
272
|
-
rb_str_new2(LAUNCH_JOBKEY_MACH_DRAINMESSAGESONCRASH));
|
273
|
-
|
274
|
-
rb_const_set(mLaunchJobKey, rb_intern("KEEPALIVE_SUCCESSFULEXIT"),
|
275
|
-
rb_str_new2(LAUNCH_JOBKEY_KEEPALIVE_SUCCESSFULEXIT));
|
276
|
-
rb_const_set(mLaunchJobKey, rb_intern("KEEPALIVE_NETWORKSTATE"),
|
277
|
-
rb_str_new2(LAUNCH_JOBKEY_KEEPALIVE_NETWORKSTATE));
|
278
|
-
rb_const_set(mLaunchJobKey, rb_intern("KEEPALIVE_PATHSTATE"),
|
279
|
-
rb_str_new2(LAUNCH_JOBKEY_KEEPALIVE_PATHSTATE));
|
280
|
-
rb_const_set(mLaunchJobKey, rb_intern("KEEPALIVE_OTHERJOBACTIVE"),
|
281
|
-
rb_str_new2(LAUNCH_JOBKEY_KEEPALIVE_OTHERJOBACTIVE));
|
282
|
-
rb_const_set(mLaunchJobKey, rb_intern("KEEPALIVE_OTHERJOBENABLED"),
|
283
|
-
rb_str_new2(LAUNCH_JOBKEY_KEEPALIVE_OTHERJOBENABLED));
|
284
|
-
rb_const_set(mLaunchJobKey, rb_intern("KEEPALIVE_AFTERINITIALDEMAND"),
|
285
|
-
rb_str_new2(LAUNCH_JOBKEY_KEEPALIVE_AFTERINITIALDEMAND));
|
286
|
-
|
287
|
-
rb_const_set(mLaunchJobKey, rb_intern("CAL_MINUTE"),
|
288
|
-
rb_str_new2(LAUNCH_JOBKEY_CAL_MINUTE));
|
289
|
-
rb_const_set(mLaunchJobKey, rb_intern("CAL_HOUR"),
|
290
|
-
rb_str_new2(LAUNCH_JOBKEY_CAL_HOUR));
|
291
|
-
rb_const_set(mLaunchJobKey, rb_intern("CAL_DAY"),
|
292
|
-
rb_str_new2(LAUNCH_JOBKEY_CAL_DAY));
|
293
|
-
rb_const_set(mLaunchJobKey, rb_intern("CAL_WEEKDAY"),
|
294
|
-
rb_str_new2(LAUNCH_JOBKEY_CAL_WEEKDAY));
|
295
|
-
rb_const_set(mLaunchJobKey, rb_intern("CAL_MONTH"),
|
296
|
-
rb_str_new2(LAUNCH_JOBKEY_CAL_MONTH));
|
297
|
-
|
298
|
-
rb_const_set(mLaunchJobKey, rb_intern("RESOURCELIMIT_CORE"),
|
299
|
-
rb_str_new2(LAUNCH_JOBKEY_RESOURCELIMIT_CORE));
|
300
|
-
rb_const_set(mLaunchJobKey, rb_intern("RESOURCELIMIT_CPU"),
|
301
|
-
rb_str_new2(LAUNCH_JOBKEY_RESOURCELIMIT_CPU));
|
302
|
-
rb_const_set(mLaunchJobKey, rb_intern("RESOURCELIMIT_DATA"),
|
303
|
-
rb_str_new2(LAUNCH_JOBKEY_RESOURCELIMIT_DATA));
|
304
|
-
rb_const_set(mLaunchJobKey, rb_intern("RESOURCELIMIT_FSIZE"),
|
305
|
-
rb_str_new2(LAUNCH_JOBKEY_RESOURCELIMIT_FSIZE));
|
306
|
-
rb_const_set(mLaunchJobKey, rb_intern("RESOURCELIMIT_MEMLOCK"),
|
307
|
-
rb_str_new2(LAUNCH_JOBKEY_RESOURCELIMIT_MEMLOCK));
|
308
|
-
rb_const_set(mLaunchJobKey, rb_intern("RESOURCELIMIT_NOFILE"),
|
309
|
-
rb_str_new2(LAUNCH_JOBKEY_RESOURCELIMIT_NOFILE));
|
310
|
-
rb_const_set(mLaunchJobKey, rb_intern("RESOURCELIMIT_NPROC"),
|
311
|
-
rb_str_new2(LAUNCH_JOBKEY_RESOURCELIMIT_NPROC));
|
312
|
-
rb_const_set(mLaunchJobKey, rb_intern("RESOURCELIMIT_RSS"),
|
313
|
-
rb_str_new2(LAUNCH_JOBKEY_RESOURCELIMIT_RSS));
|
314
|
-
rb_const_set(mLaunchJobKey, rb_intern("RESOURCELIMIT_STACK"),
|
315
|
-
rb_str_new2(LAUNCH_JOBKEY_RESOURCELIMIT_STACK));
|
316
|
-
|
317
|
-
rb_const_set(mLaunchJobKey, rb_intern("DISABLED_MACHINETYPE"),
|
318
|
-
rb_str_new2(LAUNCH_JOBKEY_DISABLED_MACHINETYPE));
|
319
|
-
rb_const_set(mLaunchJobKey, rb_intern("DISABLED_MODELNAME"),
|
320
|
-
rb_str_new2(LAUNCH_JOBKEY_DISABLED_MODELNAME));
|
321
|
-
|
322
|
-
/*
|
323
|
-
* Launch::Socket holds various socket keys
|
324
|
-
*/
|
325
|
-
mLaunchSocket = rb_define_module_under(mLaunch, "Socket");
|
326
|
-
rb_const_set(mLaunchSocket, rb_intern("TYPE"),
|
327
|
-
rb_str_new2(LAUNCH_JOBSOCKETKEY_TYPE));
|
328
|
-
rb_const_set(mLaunchSocket, rb_intern("PASSIVE"),
|
329
|
-
rb_str_new2(LAUNCH_JOBSOCKETKEY_PASSIVE));
|
330
|
-
rb_const_set(mLaunchSocket, rb_intern("BONJOUR"),
|
331
|
-
rb_str_new2(LAUNCH_JOBSOCKETKEY_BONJOUR));
|
332
|
-
rb_const_set(mLaunchSocket, rb_intern("SECUREWITHKEY"),
|
333
|
-
rb_str_new2(LAUNCH_JOBSOCKETKEY_SECUREWITHKEY));
|
334
|
-
rb_const_set(mLaunchSocket, rb_intern("PATHNAME"),
|
335
|
-
rb_str_new2(LAUNCH_JOBSOCKETKEY_PATHNAME));
|
336
|
-
rb_const_set(mLaunchSocket, rb_intern("PATHMODE"),
|
337
|
-
rb_str_new2(LAUNCH_JOBSOCKETKEY_PATHMODE));
|
338
|
-
rb_const_set(mLaunchSocket, rb_intern("NODENAME"),
|
339
|
-
rb_str_new2(LAUNCH_JOBSOCKETKEY_NODENAME));
|
340
|
-
rb_const_set(mLaunchSocket, rb_intern("SERVICENAME"),
|
341
|
-
rb_str_new2(LAUNCH_JOBSOCKETKEY_SERVICENAME));
|
342
|
-
rb_const_set(mLaunchSocket, rb_intern("FAMILY"),
|
343
|
-
rb_str_new2(LAUNCH_JOBSOCKETKEY_FAMILY));
|
344
|
-
rb_const_set(mLaunchSocket, rb_intern("PROTOCOL"),
|
345
|
-
rb_str_new2(LAUNCH_JOBSOCKETKEY_PROTOCOL));
|
346
|
-
rb_const_set(mLaunchSocket, rb_intern("MULTICASTGROUP"),
|
347
|
-
rb_str_new2(LAUNCH_JOBSOCKETKEY_MULTICASTGROUP));
|
348
|
-
|
349
|
-
/*
|
350
|
-
* Launch::JobPolicy holds the job policy keys
|
351
|
-
*/
|
352
|
-
mLaunchJobPolicy = rb_define_module_under(mLaunch, "JobPolicy");
|
353
|
-
rb_const_set(mLaunchJobPolicy, rb_intern("DENYCREATINGOTHERJOBS"),
|
354
|
-
rb_str_new2(LAUNCH_JOBPOLICY_DENYCREATINGOTHERJOBS));
|
355
|
-
}
|