trinidad_init_services 1.1.3 → 1.1.4

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.
Files changed (61) hide show
  1. data/.gitignore +5 -0
  2. data/Gemfile +3 -0
  3. data/History.txt +6 -0
  4. data/README.md +95 -0
  5. data/Rakefile +9 -58
  6. data/bin/trinidad_init_service +3 -4
  7. data/init.d/trinidad.erb +33 -12
  8. data/jsvc-unix-src/CHANGES.txt +62 -0
  9. data/jsvc-unix-src/INSTALL.txt +81 -0
  10. data/jsvc-unix-src/Makedefs.in +32 -0
  11. data/jsvc-unix-src/Makefile.in +42 -0
  12. data/jsvc-unix-src/configure +4417 -0
  13. data/jsvc-unix-src/configure.in +141 -0
  14. data/jsvc-unix-src/man/README +20 -0
  15. data/jsvc-unix-src/man/fetch.sh +36 -0
  16. data/jsvc-unix-src/man/jsvc.1.xml +214 -0
  17. data/jsvc-unix-src/native/.indent.pro +7 -0
  18. data/jsvc-unix-src/native/Makefile.in +46 -0
  19. data/jsvc-unix-src/native/arguments.c +476 -0
  20. data/jsvc-unix-src/native/arguments.h +94 -0
  21. data/jsvc-unix-src/native/debug.c +87 -0
  22. data/jsvc-unix-src/native/debug.h +65 -0
  23. data/jsvc-unix-src/native/dso-dlfcn.c +62 -0
  24. data/jsvc-unix-src/native/dso-dyld.c +153 -0
  25. data/jsvc-unix-src/native/dso.h +38 -0
  26. data/jsvc-unix-src/native/help.c +106 -0
  27. data/jsvc-unix-src/native/help.h +24 -0
  28. data/jsvc-unix-src/native/home.c +265 -0
  29. data/jsvc-unix-src/native/home.h +47 -0
  30. data/jsvc-unix-src/native/java.c +608 -0
  31. data/jsvc-unix-src/native/java.h +35 -0
  32. data/jsvc-unix-src/native/jsvc-unix.c +1267 -0
  33. data/jsvc-unix-src/native/jsvc.h +55 -0
  34. data/jsvc-unix-src/native/location.c +151 -0
  35. data/jsvc-unix-src/native/location.h +29 -0
  36. data/jsvc-unix-src/native/locks.c +52 -0
  37. data/jsvc-unix-src/native/locks.h +40 -0
  38. data/jsvc-unix-src/native/replace.c +121 -0
  39. data/jsvc-unix-src/native/replace.h +39 -0
  40. data/jsvc-unix-src/native/signals.c +105 -0
  41. data/jsvc-unix-src/native/signals.h +34 -0
  42. data/jsvc-unix-src/native/version.h +63 -0
  43. data/jsvc-unix-src/support/apfunctions.m4 +110 -0
  44. data/jsvc-unix-src/support/apjava.m4 +94 -0
  45. data/jsvc-unix-src/support/apsupport.m4 +155 -0
  46. data/jsvc-unix-src/support/buildconf.sh +33 -0
  47. data/jsvc-unix-src/support/config.guess +1371 -0
  48. data/jsvc-unix-src/support/config.sub +1760 -0
  49. data/jsvc-unix-src/support/install.sh +128 -0
  50. data/jsvc-unix-src/support/mkdist.sh +104 -0
  51. data/lib/trinidad/daemon.rb +31 -0
  52. data/lib/trinidad_init_services.rb +2 -30
  53. data/lib/trinidad_init_services/configuration.rb +91 -14
  54. data/lib/trinidad_init_services/version.rb +5 -0
  55. data/spec/spec_helper.rb +5 -6
  56. data/spec/trinidad_daemon_spec.rb +0 -1
  57. data/spec/trinidad_init_services/configuration_spec.rb +34 -1
  58. data/trinidad_init_services.gemspec +14 -51
  59. metadata +146 -87
  60. data/README +0 -63
  61. data/trinidad-libs/jsvc_linux +0 -0
@@ -0,0 +1,5 @@
1
+ module Trinidad
2
+ module InitServices
3
+ VERSION = '1.1.4'
4
+ end
5
+ end
@@ -6,14 +6,13 @@ rescue LoadError
6
6
  require 'rspec'
7
7
  end
8
8
 
9
- $:.unshift(File.dirname(__FILE__) + '/../lib')
10
-
11
- require 'trinidad_init_services/configuration'
12
-
13
- require 'java'
14
9
  require 'mocha'
15
- require 'fileutils'
16
10
 
17
11
  RSpec.configure do |config|
18
12
  config.mock_with :mocha
19
13
  end
14
+
15
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
16
+
17
+ require 'trinidad_init_services'
18
+ require 'trinidad/daemon'
@@ -1,5 +1,4 @@
1
1
  require File.expand_path('spec_helper', File.dirname(__FILE__))
2
- require 'trinidad_init_services'
3
2
 
4
3
  Trinidad::Daemon.module_eval do
5
4
  def server; @server; end
@@ -1,6 +1,9 @@
1
1
  require File.expand_path('spec_helper', File.join(File.dirname(__FILE__), '..'))
2
+
2
3
  require 'yaml'
3
4
  require 'rbconfig'
5
+ require 'fileutils'
6
+ require 'java'
4
7
 
5
8
  describe Trinidad::InitServices::Configuration do
6
9
 
@@ -65,7 +68,37 @@ describe Trinidad::InitServices::Configuration do
65
68
  subject.configure(config_defaults.merge 'run_user' => username)
66
69
 
67
70
  init_file_content = File.read(init_file) rescue ''
68
- init_file_content.match(/RUN_USER="#{username}"/).should be_true
71
+ init_file_content.should =~ /RUN_USER="#{username}"/
72
+ end
73
+
74
+ unless (`which make` rescue '').empty?
75
+
76
+ before(:all) do
77
+ FileUtils.rm_r "/tmp/jsvc-unix-src" if File.exist? "/tmp/jsvc-unix-src"
78
+ end
79
+
80
+ it "configures and compiles jsvc" do
81
+ config_options = config_defaults.merge 'jsvc_path' => nil
82
+ config_options['jsvc_unpack_dir'] = '/tmp'
83
+
84
+ java_home = java.lang.System.get_property("java.home")
85
+ java_home = java_home[0...-4] if java_home[-4..-1] == '/jre'
86
+ config_options['java_home'] = java_home # need a JDK dir
87
+
88
+ subject = Trinidad::InitServices::Configuration.new
89
+ subject.instance_eval do # a bit of stubbing/mocking :
90
+ def detect_jsvc_path; nil; end
91
+ def ask_path(path, default = nil)
92
+ raise path unless path =~ /path to jsvc .*/; default
93
+ end
94
+ end
95
+
96
+ subject.configure(config_options)
97
+
98
+ init_file_content = File.read(init_file) rescue ''
99
+ init_file_content.should =~ /JSVC=\/tmp\/jsvc\-unix\-src\/jsvc/
100
+ end
101
+
69
102
  end
70
103
 
71
104
  end
@@ -1,33 +1,22 @@
1
- ## This is the rakegem gemspec template. Make sure you read and understand
2
- ## all of the comments. Some sections require modification, and others can
3
- ## be deleted if you don't need them. Once you understand the contents of
4
- ## this file, feel free to delete any comments that begin with two hash marks.
5
- ## You can find comprehensive Gem::Specification documentation, at
6
- ## http://docs.rubygems.org/read/chapter/20
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require 'trinidad_init_services/version'
4
+
7
5
  Gem::Specification.new do |s|
8
6
  s.specification_version = 2 if s.respond_to? :specification_version=
9
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
8
  s.rubygems_version = '1.3.5'
11
-
12
- ## Leave these as is they will be modified for you by the rake gemspec task.
13
- ## If your rubyforge_project name is different, then edit it and comment out
14
- ## the sub! line in the Rakefile
9
+
15
10
  s.name = 'trinidad_init_services'
16
- s.version = '1.1.3'
17
- s.date = '2012-02-20'
11
+ s.version = Trinidad::InitServices::VERSION
18
12
  s.rubyforge_project = 'trinidad_init_services'
19
-
20
- ## Make sure your summary is short. The description may be as long
21
- ## as you like.
13
+
22
14
  s.summary = "Trinidad init service scripts based on Apache Commons Daemon"
23
- s.description = "Trinidad init service scripts on Apache Commons Daemon and JRuby-jsvc, compatible with Unix and Windows services"
24
-
25
- ## List the primary authors. If there are a bunch of authors, it's probably
26
- ## better to set the email to an email list or something. If you don't have
27
- ## a custom homepage, consider using your GitHub URL or the like.
15
+ s.description = "Trinidad init service scripts on Apache Commons Daemon and JRuby-Jsvc, compatible with Unix and Windows services"
16
+
28
17
  s.authors = ["David Calavera"]
29
18
  s.email = 'calavera@apache.org'
30
- s.homepage = 'http://github.com/calavera/trinidad_daemon'
19
+ s.homepage = 'http://github.com/trinidad/trinidad_init_services'
31
20
 
32
21
  ## This gets added to the $LOAD_PATH so that 'lib/NAME.rb' can be required as
33
22
  ## require 'NAME.rb' or'/lib/NAME/file.rb' can be as require 'NAME/file.rb'
@@ -35,12 +24,12 @@ Gem::Specification.new do |s|
35
24
 
36
25
  ## If your gem includes any executables, list them here.
37
26
  s.executables = ["trinidad_init_service"]
38
- s.default_executable = 'trinidad_daemon_install'
27
+ s.default_executable = 'trinidad_init_service'
39
28
 
40
29
  ## Specify any RDoc options here. You'll want to add your README and
41
30
  ## LICENSE files to the extra_rdoc_files list.
42
31
  s.rdoc_options = ["--charset=UTF-8"]
43
- s.extra_rdoc_files = %w[README LICENSE]
32
+ s.extra_rdoc_files = %w[README.md LICENSE]
44
33
 
45
34
  ## List your runtime dependencies here. Runtime dependencies are those
46
35
  ## that are needed for an end user to actually USE your code.
@@ -49,39 +38,13 @@ Gem::Specification.new do |s|
49
38
  s.add_development_dependency('rspec', '>= 2.7.1')
50
39
  s.add_development_dependency('mocha', '>= 0.10')
51
40
 
52
- ## Leave this section as-is. It will be automatically generated from the
53
- ## contents of your Git repository via the gemspec task. DO NOT REMOVE
54
- ## THE MANIFEST COMMENTS, they are used as delimiters by the task.
55
- # = MANIFEST =
56
- s.files = %w[
57
- History.txt
58
- LICENSE
59
- README
60
- Rakefile
61
- bin/trinidad_init_service
62
- init.d/trinidad.erb
63
- lib/trinidad_init_services.rb
64
- lib/trinidad_init_services/configuration.rb
65
- spec/spec_helper.rb
66
- spec/stubs/trinidad.rb
67
- spec/stubs/trinidad.yml
68
- spec/trinidad_daemon_spec.rb
69
- spec/trinidad_init_services/configuration_spec.rb
70
- trinidad-libs/commons-daemon.jar
71
- trinidad-libs/jruby-jsvc.jar
72
- trinidad-libs/jsvc_darwin
73
- trinidad-libs/jsvc_linux
74
- trinidad-libs/prunsrv_amd64.exe
75
- trinidad-libs/prunsrv_ia64.exe
76
- trinidad_init_services.gemspec
77
- ]
78
- # = MANIFEST =
41
+ s.files = `git ls-files`.split("\n")
79
42
 
80
43
  ## Test files will be grabbed from the file list. Make sure the path glob
81
44
  ## matches what you actually use.
82
45
  ## s.test_files = s.files.select { |path| path =~ /^test\/test_.*\.rb/ }
83
46
 
84
- s.post_install_message = <<TEXT
47
+ s.post_install_message = <<TEXT
85
48
 
86
49
  ------------------------------------------------------------------------------------
87
50
 
metadata CHANGED
@@ -1,104 +1,163 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: trinidad_init_services
3
- version: !ruby/object:Gem::Version
4
- version: 1.1.3
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: 1.1.4
6
6
  platform: ruby
7
- authors:
8
- - David Calavera
7
+ authors:
8
+ - David Calavera
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-20 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: trinidad
16
- requirement: &2162638580 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: 1.3.2
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: *2162638580
25
- - !ruby/object:Gem::Dependency
26
- name: rspec
27
- requirement: &2162638100 !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: 2.7.1
33
- type: :development
34
- prerelease: false
35
- version_requirements: *2162638100
36
- - !ruby/object:Gem::Dependency
37
- name: mocha
38
- requirement: &2162637580 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '0.10'
44
- type: :development
45
- prerelease: false
46
- version_requirements: *2162637580
47
- description: Trinidad init service scripts on Apache Commons Daemon and JRuby-jsvc,
48
- compatible with Unix and Windows services
12
+
13
+ date: 2012-03-01 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: trinidad
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.3.2
24
+ type: :runtime
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: rspec
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 2.7.1
35
+ type: :development
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ name: mocha
39
+ prerelease: false
40
+ requirement: &id003 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0.10"
46
+ type: :development
47
+ version_requirements: *id003
48
+ description: Trinidad init service scripts on Apache Commons Daemon and JRuby-Jsvc, compatible with Unix and Windows services
49
49
  email: calavera@apache.org
50
- executables:
51
- - trinidad_init_service
50
+ executables:
51
+ - trinidad_init_service
52
52
  extensions: []
53
- extra_rdoc_files:
54
- - README
55
- - LICENSE
56
- files:
57
- - History.txt
58
- - LICENSE
59
- - README
60
- - Rakefile
61
- - bin/trinidad_init_service
62
- - init.d/trinidad.erb
63
- - lib/trinidad_init_services.rb
64
- - lib/trinidad_init_services/configuration.rb
65
- - spec/spec_helper.rb
66
- - spec/stubs/trinidad.rb
67
- - spec/stubs/trinidad.yml
68
- - spec/trinidad_daemon_spec.rb
69
- - spec/trinidad_init_services/configuration_spec.rb
70
- - trinidad-libs/commons-daemon.jar
71
- - trinidad-libs/jruby-jsvc.jar
72
- - trinidad-libs/jsvc_darwin
73
- - trinidad-libs/jsvc_linux
74
- - trinidad-libs/prunsrv_amd64.exe
75
- - trinidad-libs/prunsrv_ia64.exe
76
- - trinidad_init_services.gemspec
77
- homepage: http://github.com/calavera/trinidad_daemon
53
+
54
+ extra_rdoc_files:
55
+ - README.md
56
+ - LICENSE
57
+ files:
58
+ - .gitignore
59
+ - Gemfile
60
+ - History.txt
61
+ - LICENSE
62
+ - README.md
63
+ - Rakefile
64
+ - bin/trinidad_init_service
65
+ - init.d/trinidad.erb
66
+ - jsvc-unix-src/CHANGES.txt
67
+ - jsvc-unix-src/INSTALL.txt
68
+ - jsvc-unix-src/Makedefs.in
69
+ - jsvc-unix-src/Makefile.in
70
+ - jsvc-unix-src/configure
71
+ - jsvc-unix-src/configure.in
72
+ - jsvc-unix-src/man/README
73
+ - jsvc-unix-src/man/fetch.sh
74
+ - jsvc-unix-src/man/jsvc.1.xml
75
+ - jsvc-unix-src/native/.indent.pro
76
+ - jsvc-unix-src/native/Makefile.in
77
+ - jsvc-unix-src/native/arguments.c
78
+ - jsvc-unix-src/native/arguments.h
79
+ - jsvc-unix-src/native/debug.c
80
+ - jsvc-unix-src/native/debug.h
81
+ - jsvc-unix-src/native/dso-dlfcn.c
82
+ - jsvc-unix-src/native/dso-dyld.c
83
+ - jsvc-unix-src/native/dso.h
84
+ - jsvc-unix-src/native/help.c
85
+ - jsvc-unix-src/native/help.h
86
+ - jsvc-unix-src/native/home.c
87
+ - jsvc-unix-src/native/home.h
88
+ - jsvc-unix-src/native/java.c
89
+ - jsvc-unix-src/native/java.h
90
+ - jsvc-unix-src/native/jsvc-unix.c
91
+ - jsvc-unix-src/native/jsvc.h
92
+ - jsvc-unix-src/native/location.c
93
+ - jsvc-unix-src/native/location.h
94
+ - jsvc-unix-src/native/locks.c
95
+ - jsvc-unix-src/native/locks.h
96
+ - jsvc-unix-src/native/replace.c
97
+ - jsvc-unix-src/native/replace.h
98
+ - jsvc-unix-src/native/signals.c
99
+ - jsvc-unix-src/native/signals.h
100
+ - jsvc-unix-src/native/version.h
101
+ - jsvc-unix-src/support/apfunctions.m4
102
+ - jsvc-unix-src/support/apjava.m4
103
+ - jsvc-unix-src/support/apsupport.m4
104
+ - jsvc-unix-src/support/buildconf.sh
105
+ - jsvc-unix-src/support/config.guess
106
+ - jsvc-unix-src/support/config.sub
107
+ - jsvc-unix-src/support/install.sh
108
+ - jsvc-unix-src/support/mkdist.sh
109
+ - lib/trinidad/daemon.rb
110
+ - lib/trinidad_init_services.rb
111
+ - lib/trinidad_init_services/configuration.rb
112
+ - lib/trinidad_init_services/version.rb
113
+ - spec/spec_helper.rb
114
+ - spec/stubs/trinidad.rb
115
+ - spec/stubs/trinidad.yml
116
+ - spec/trinidad_daemon_spec.rb
117
+ - spec/trinidad_init_services/configuration_spec.rb
118
+ - trinidad-libs/commons-daemon.jar
119
+ - trinidad-libs/jruby-jsvc.jar
120
+ - trinidad-libs/jsvc_darwin
121
+ - trinidad-libs/prunsrv_amd64.exe
122
+ - trinidad-libs/prunsrv_ia64.exe
123
+ - trinidad_init_services.gemspec
124
+ homepage: http://github.com/trinidad/trinidad_init_services
78
125
  licenses: []
79
- post_install_message: ! "\n------------------------------------------------------------------------------------\n\nPlease
80
- now run:\n\n $ jruby -S trinidad_init_service\n\nto complete the installation.\n\n------------------------------------------------------------------------------------\n\n"
81
- rdoc_options:
82
- - --charset=UTF-8
83
- require_paths:
84
- - lib
85
- required_ruby_version: !ruby/object:Gem::Requirement
126
+
127
+ post_install_message: |+
128
+
129
+ ------------------------------------------------------------------------------------
130
+
131
+ Please now run:
132
+
133
+ $ jruby -S trinidad_init_service
134
+
135
+ to complete the installation.
136
+
137
+ ------------------------------------------------------------------------------------
138
+
139
+ rdoc_options:
140
+ - --charset=UTF-8
141
+ require_paths:
142
+ - lib
143
+ required_ruby_version: !ruby/object:Gem::Requirement
86
144
  none: false
87
- requirements:
88
- - - ! '>='
89
- - !ruby/object:Gem::Version
90
- version: '0'
91
- required_rubygems_version: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ version: "0"
149
+ required_rubygems_version: !ruby/object:Gem::Requirement
92
150
  none: false
93
- requirements:
94
- - - ! '>='
95
- - !ruby/object:Gem::Version
96
- version: '0'
151
+ requirements:
152
+ - - ">="
153
+ - !ruby/object:Gem::Version
154
+ version: "0"
97
155
  requirements: []
156
+
98
157
  rubyforge_project: trinidad_init_services
99
- rubygems_version: 1.8.10
158
+ rubygems_version: 1.8.15
100
159
  signing_key:
101
160
  specification_version: 2
102
161
  summary: Trinidad init service scripts based on Apache Commons Daemon
103
162
  test_files: []
104
- has_rdoc:
163
+
data/README DELETED
@@ -1,63 +0,0 @@
1
- Trinidad init services
2
- ===============
3
-
4
- Trinidad's init services library based on Apache Commons Daemon and JRuby-jsvc. Works on Unix and Windows systems.
5
-
6
- Installation
7
- ============
8
-
9
- $ jruby -S gem install trinidad_init_services
10
-
11
- When the gem is installed the user must launch the installation process:
12
-
13
- $ jruby -S trinidad_init_service
14
-
15
- This installer guides you through the configuration process and generates a
16
- init.d script if you are on a unix system or creates the service if you are
17
- on a windows box.
18
-
19
- You can optionally provide a configuration file to the trinidad_init_service
20
- command. An example configuration file might look like this:
21
-
22
- app_path: "/home/myuser/app"
23
- trinidad_options: "-e production"
24
- jruby_home: "/opt/jruby"
25
- ruby_compat_version: RUBY1_8
26
- trinidad_name: Trinidad
27
- jsvc_path: "/usr/bin/jsvc"
28
- java_home: "/opt/java"
29
- output_path: "/etc/init.d"
30
- pid_file: "/tmp/trinidad.pid"
31
- log_file: "/tmp/trinidad.log"
32
-
33
- You can then run the installer like so:
34
-
35
- $ jruby -S trinidad_init_service trinidad_init_config.yml
36
-
37
- If any of the required options are not provided in the configuration file, then the installer will prompt you
38
- for them.
39
-
40
- Unix
41
- ====
42
-
43
- Execution
44
- =========
45
-
46
- When the installation process finishes you can use the script trinidad-daemon.sh
47
- generated to launch the server as a daemon with the options start|stop|restart,
48
- i.e:
49
-
50
- $ /etc/init.d/trinidad restart
51
-
52
- Windows
53
- =======
54
-
55
- Execution
56
- =========
57
-
58
- Open the `Services` panel under `Administrative Tools` and look for a
59
- service called `Trinidad`.
60
-
61
- == Copyright
62
-
63
- Copyright (c) 2011 David Calavera<calavera@apache.org>. See LICENSE for details.