trinidad_init_services 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +4 -0
- data/Rakefile +1 -1
- data/lib/trinidad/daemon.rb +1 -3
- data/lib/trinidad_init_services/configuration.rb +22 -19
- data/lib/trinidad_init_services/version.rb +1 -1
- data/spec/trinidad_init_services/configuration_spec.rb +21 -3
- data/trinidad-libs/windows/amd64/prunsrv.exe +0 -0
- data/trinidad-libs/windows/ia64/prunsrv.exe +0 -0
- data/trinidad-libs/windows/prunsrv.exe +0 -0
- data/trinidad_init_services.gemspec +2 -2
- metadata +141 -115
- data/trinidad-libs/prunsrv_amd64.exe +0 -0
- data/trinidad-libs/prunsrv_ia64.exe +0 -0
data/History.txt
CHANGED
data/Rakefile
CHANGED
data/lib/trinidad/daemon.rb
CHANGED
@@ -13,19 +13,12 @@ module Trinidad
|
|
13
13
|
@stdout = stdout
|
14
14
|
end
|
15
15
|
|
16
|
-
def initialize_paths
|
16
|
+
def initialize_paths(jruby_home = default_jruby_home)
|
17
17
|
@trinidad_daemon_path = File.expand_path('../../trinidad/daemon.rb', __FILE__)
|
18
18
|
@jars_path = File.expand_path('../../../trinidad-libs', __FILE__)
|
19
19
|
|
20
20
|
@classpath = ['jruby-jsvc.jar', 'commons-daemon.jar'].map { |jar| File.join(@jars_path, jar) }
|
21
|
-
@classpath << File.join(
|
22
|
-
end
|
23
|
-
|
24
|
-
def collect_windows_opts(options_ask, defaults)
|
25
|
-
options_ask << '(separated by `;`)'
|
26
|
-
name_ask = 'Service name? {Alphanumeric and spaces only}'
|
27
|
-
name_default = 'Trinidad'
|
28
|
-
@trinidad_name = defaults["trinidad_name"] || ask(name_ask, name_default)
|
21
|
+
@classpath << File.join(jruby_home, 'lib', 'jruby.jar')
|
29
22
|
end
|
30
23
|
|
31
24
|
def configure_jruby_opts
|
@@ -49,7 +42,7 @@ module Trinidad
|
|
49
42
|
@jruby_home = defaults["jruby_home"] || ask_path('JRuby home?', default_jruby_home)
|
50
43
|
@ruby_compat_version = defaults["ruby_compat_version"] || ask('Ruby 1.8.x or 1.9.x compatibility?', default_ruby_compat_version)
|
51
44
|
@jruby_opts = configure_jruby_opts
|
52
|
-
initialize_paths
|
45
|
+
initialize_paths(@jruby_home)
|
53
46
|
|
54
47
|
windows? ? configure_windows_service : configure_unix_daemon(defaults)
|
55
48
|
puts 'Done.'
|
@@ -92,6 +85,13 @@ module Trinidad
|
|
92
85
|
FileUtils.chmod(@run_user == '' ? 0744 : 0755, trinidad_file)
|
93
86
|
end
|
94
87
|
|
88
|
+
def collect_windows_opts(options_ask, defaults)
|
89
|
+
options_ask << '(separated by `;`)'
|
90
|
+
name_ask = 'Service name? {Alphanumeric and spaces only}'
|
91
|
+
name_default = 'Trinidad'
|
92
|
+
@trinidad_name = defaults["trinidad_name"] || ask(name_ask, name_default)
|
93
|
+
end
|
94
|
+
|
95
95
|
def configure_windows_service
|
96
96
|
srv_path = bundled_prunsrv_path
|
97
97
|
trinidad_service_id = @trinidad_name.gsub(/\W/, '')
|
@@ -138,11 +138,7 @@ module Trinidad
|
|
138
138
|
RbConfig::CONFIG['host_os'] =~ /darwin/i
|
139
139
|
end
|
140
140
|
|
141
|
-
def
|
142
|
-
RbConfig::CONFIG['arch'] =~ /i686|ia64/i
|
143
|
-
end
|
144
|
-
|
145
|
-
def bundled_jsvc_path
|
141
|
+
def bundled_jsvc_path # only called on *nix
|
146
142
|
jsvc = 'jsvc_' + (macosx? ? 'darwin' : 'linux')
|
147
143
|
jsvc_path = File.join(@jars_path, jsvc)
|
148
144
|
# linux version is no longer bundled - as long as it is not present jsvc
|
@@ -150,7 +146,7 @@ module Trinidad
|
|
150
146
|
File.exist?(jsvc_path) ? jsvc_path : nil
|
151
147
|
end
|
152
148
|
|
153
|
-
def detect_jsvc_path
|
149
|
+
def detect_jsvc_path # only called on *nix
|
154
150
|
jsvc_path = `which jsvc` # "/usr/bin/jsvc\n"
|
155
151
|
jsvc_path.chomp!
|
156
152
|
jsvc_path.empty? ? bundled_jsvc_path : jsvc_path
|
@@ -210,9 +206,16 @@ module Trinidad
|
|
210
206
|
nil
|
211
207
|
end
|
212
208
|
|
213
|
-
def bundled_prunsrv_path
|
214
|
-
|
215
|
-
|
209
|
+
def bundled_prunsrv_path(arch = java.lang.System.getProperty("os.arch"))
|
210
|
+
# "amd64", "i386", "x86", "x86_64"
|
211
|
+
path = 'windows'
|
212
|
+
if arch =~ /amd64/i # amd64
|
213
|
+
path += '/amd64'
|
214
|
+
elsif arch =~ /64/i # x86_64
|
215
|
+
path += '/ia64'
|
216
|
+
# else "i386", "x86"
|
217
|
+
end
|
218
|
+
File.join(@jars_path, path, 'prunsrv.exe')
|
216
219
|
end
|
217
220
|
|
218
221
|
def make_path_dir(path, error = nil)
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require File.expand_path('spec_helper', File.join(File.dirname(__FILE__), '..'))
|
2
2
|
|
3
3
|
require 'yaml'
|
4
|
-
require 'rbconfig'
|
5
4
|
require 'fileutils'
|
6
5
|
require 'java'
|
7
6
|
|
@@ -32,7 +31,7 @@ describe Trinidad::InitServices::Configuration do
|
|
32
31
|
|
33
32
|
init_file_content.match(/RUN_USER=""/).should be_true
|
34
33
|
end
|
35
|
-
|
34
|
+
|
36
35
|
it "makes pid_file and log_file dirs" do
|
37
36
|
pids_dir = File.join(tmp_dir, "pids")
|
38
37
|
logs_dir = File.join(tmp_dir, "logs")
|
@@ -54,7 +53,7 @@ describe Trinidad::InitServices::Configuration do
|
|
54
53
|
end
|
55
54
|
end
|
56
55
|
|
57
|
-
if
|
56
|
+
if java.lang.System.getProperty('os.name') !~ /windows/i
|
58
57
|
|
59
58
|
it "fails for non-existing run user" do
|
60
59
|
username = random_username
|
@@ -103,6 +102,25 @@ describe Trinidad::InitServices::Configuration do
|
|
103
102
|
|
104
103
|
end
|
105
104
|
|
105
|
+
it "resolves bundled bundled prunsrv.exe based on system arch" do
|
106
|
+
trinidad_libs = File.expand_path('trinidad-libs', File.join(File.dirname(__FILE__), '../..'))
|
107
|
+
subject = Trinidad::InitServices::Configuration.new
|
108
|
+
subject.initialize_paths
|
109
|
+
|
110
|
+
path = subject.send :bundled_prunsrv_path, "amd64"
|
111
|
+
path.should == File.join(trinidad_libs, 'windows/amd64/prunsrv.exe')
|
112
|
+
|
113
|
+
path = subject.send :bundled_prunsrv_path, "x86_64"
|
114
|
+
path.should == File.join(trinidad_libs, 'windows/ia64/prunsrv.exe')
|
115
|
+
|
116
|
+
path = subject.send :bundled_prunsrv_path, "i386"
|
117
|
+
path.should == File.join(trinidad_libs, 'windows/prunsrv.exe')
|
118
|
+
|
119
|
+
path = subject.send :bundled_prunsrv_path, "x86"
|
120
|
+
path.should == File.join(trinidad_libs, 'windows/prunsrv.exe')
|
121
|
+
end
|
122
|
+
|
123
|
+
|
106
124
|
private
|
107
125
|
|
108
126
|
def config_defaults
|
Binary file
|
Binary file
|
Binary file
|
@@ -46,7 +46,7 @@ Gem::Specification.new do |s|
|
|
46
46
|
|
47
47
|
s.post_install_message = <<TEXT
|
48
48
|
|
49
|
-
|
49
|
+
--------------------------------------------------------------------------------
|
50
50
|
|
51
51
|
Please now run:
|
52
52
|
|
@@ -54,7 +54,7 @@ Please now run:
|
|
54
54
|
|
55
55
|
to complete the installation.
|
56
56
|
|
57
|
-
|
57
|
+
--------------------------------------------------------------------------------
|
58
58
|
|
59
59
|
TEXT
|
60
60
|
end
|
metadata
CHANGED
@@ -1,132 +1,152 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trinidad_init_services
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 25
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 1
|
9
|
+
- 5
|
10
|
+
version: 1.1.5
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
|
-
|
13
|
+
- David Calavera
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date: 2012-03-
|
18
|
+
date: 2012-03-06 00:00:00 Z
|
14
19
|
dependencies:
|
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
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: trinidad
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 31
|
29
|
+
segments:
|
30
|
+
- 1
|
31
|
+
- 3
|
32
|
+
- 2
|
33
|
+
version: 1.3.2
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rspec
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 17
|
45
|
+
segments:
|
46
|
+
- 2
|
47
|
+
- 7
|
48
|
+
- 1
|
49
|
+
version: 2.7.1
|
50
|
+
type: :development
|
51
|
+
version_requirements: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: mocha
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 31
|
61
|
+
segments:
|
62
|
+
- 0
|
63
|
+
- 10
|
64
|
+
version: "0.10"
|
65
|
+
type: :development
|
66
|
+
version_requirements: *id003
|
48
67
|
description: Trinidad init service scripts on Apache Commons Daemon and JRuby-Jsvc, compatible with Unix and Windows services
|
49
68
|
email: calavera@apache.org
|
50
69
|
executables:
|
51
|
-
|
70
|
+
- trinidad_init_service
|
52
71
|
extensions: []
|
53
72
|
|
54
73
|
extra_rdoc_files:
|
55
|
-
|
56
|
-
|
74
|
+
- README.md
|
75
|
+
- LICENSE
|
57
76
|
files:
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
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
|
-
|
77
|
+
- .gitignore
|
78
|
+
- Gemfile
|
79
|
+
- History.txt
|
80
|
+
- LICENSE
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- bin/trinidad_init_service
|
84
|
+
- init.d/trinidad.erb
|
85
|
+
- jsvc-unix-src/CHANGES.txt
|
86
|
+
- jsvc-unix-src/INSTALL.txt
|
87
|
+
- jsvc-unix-src/Makedefs.in
|
88
|
+
- jsvc-unix-src/Makefile.in
|
89
|
+
- jsvc-unix-src/configure
|
90
|
+
- jsvc-unix-src/configure.in
|
91
|
+
- jsvc-unix-src/man/README
|
92
|
+
- jsvc-unix-src/man/fetch.sh
|
93
|
+
- jsvc-unix-src/man/jsvc.1.xml
|
94
|
+
- jsvc-unix-src/native/.indent.pro
|
95
|
+
- jsvc-unix-src/native/Makefile.in
|
96
|
+
- jsvc-unix-src/native/arguments.c
|
97
|
+
- jsvc-unix-src/native/arguments.h
|
98
|
+
- jsvc-unix-src/native/debug.c
|
99
|
+
- jsvc-unix-src/native/debug.h
|
100
|
+
- jsvc-unix-src/native/dso-dlfcn.c
|
101
|
+
- jsvc-unix-src/native/dso-dyld.c
|
102
|
+
- jsvc-unix-src/native/dso.h
|
103
|
+
- jsvc-unix-src/native/help.c
|
104
|
+
- jsvc-unix-src/native/help.h
|
105
|
+
- jsvc-unix-src/native/home.c
|
106
|
+
- jsvc-unix-src/native/home.h
|
107
|
+
- jsvc-unix-src/native/java.c
|
108
|
+
- jsvc-unix-src/native/java.h
|
109
|
+
- jsvc-unix-src/native/jsvc-unix.c
|
110
|
+
- jsvc-unix-src/native/jsvc.h
|
111
|
+
- jsvc-unix-src/native/location.c
|
112
|
+
- jsvc-unix-src/native/location.h
|
113
|
+
- jsvc-unix-src/native/locks.c
|
114
|
+
- jsvc-unix-src/native/locks.h
|
115
|
+
- jsvc-unix-src/native/replace.c
|
116
|
+
- jsvc-unix-src/native/replace.h
|
117
|
+
- jsvc-unix-src/native/signals.c
|
118
|
+
- jsvc-unix-src/native/signals.h
|
119
|
+
- jsvc-unix-src/native/version.h
|
120
|
+
- jsvc-unix-src/support/apfunctions.m4
|
121
|
+
- jsvc-unix-src/support/apjava.m4
|
122
|
+
- jsvc-unix-src/support/apsupport.m4
|
123
|
+
- jsvc-unix-src/support/buildconf.sh
|
124
|
+
- jsvc-unix-src/support/config.guess
|
125
|
+
- jsvc-unix-src/support/config.sub
|
126
|
+
- jsvc-unix-src/support/install.sh
|
127
|
+
- jsvc-unix-src/support/mkdist.sh
|
128
|
+
- lib/trinidad/daemon.rb
|
129
|
+
- lib/trinidad_init_services.rb
|
130
|
+
- lib/trinidad_init_services/configuration.rb
|
131
|
+
- lib/trinidad_init_services/version.rb
|
132
|
+
- spec/spec_helper.rb
|
133
|
+
- spec/stubs/trinidad.rb
|
134
|
+
- spec/stubs/trinidad.yml
|
135
|
+
- spec/trinidad_daemon_spec.rb
|
136
|
+
- spec/trinidad_init_services/configuration_spec.rb
|
137
|
+
- trinidad-libs/commons-daemon.jar
|
138
|
+
- trinidad-libs/jruby-jsvc.jar
|
139
|
+
- trinidad-libs/jsvc_darwin
|
140
|
+
- trinidad-libs/windows/amd64/prunsrv.exe
|
141
|
+
- trinidad-libs/windows/ia64/prunsrv.exe
|
142
|
+
- trinidad-libs/windows/prunsrv.exe
|
143
|
+
- trinidad_init_services.gemspec
|
124
144
|
homepage: http://github.com/trinidad/trinidad_init_services
|
125
145
|
licenses: []
|
126
146
|
|
127
147
|
post_install_message: |+
|
128
148
|
|
129
|
-
|
149
|
+
--------------------------------------------------------------------------------
|
130
150
|
|
131
151
|
Please now run:
|
132
152
|
|
@@ -134,24 +154,30 @@ post_install_message: |+
|
|
134
154
|
|
135
155
|
to complete the installation.
|
136
156
|
|
137
|
-
|
157
|
+
--------------------------------------------------------------------------------
|
138
158
|
|
139
159
|
rdoc_options:
|
140
|
-
|
160
|
+
- --charset=UTF-8
|
141
161
|
require_paths:
|
142
|
-
|
162
|
+
- lib
|
143
163
|
required_ruby_version: !ruby/object:Gem::Requirement
|
144
164
|
none: false
|
145
165
|
requirements:
|
146
|
-
|
147
|
-
|
148
|
-
|
166
|
+
- - ">="
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
hash: 3
|
169
|
+
segments:
|
170
|
+
- 0
|
171
|
+
version: "0"
|
149
172
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
173
|
none: false
|
151
174
|
requirements:
|
152
|
-
|
153
|
-
|
154
|
-
|
175
|
+
- - ">="
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
hash: 3
|
178
|
+
segments:
|
179
|
+
- 0
|
180
|
+
version: "0"
|
155
181
|
requirements: []
|
156
182
|
|
157
183
|
rubyforge_project: trinidad_init_services
|
Binary file
|
Binary file
|