trinidad_daemon 0.3.0 → 0.3.1

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 CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.3.1
2
+
3
+ * Use absolute path for configuration options
4
+ * Start Trinidad from the application path
5
+
1
6
  == 0.3.0
2
7
 
3
8
  * Remove init script extension
data/README CHANGED
@@ -9,7 +9,7 @@ are finding with the current forking process.
9
9
  Dependencies
10
10
  ============
11
11
 
12
- The Jsvc binary file is required, but it's already available for all the
12
+ The Jsvc native binary file is required, but it's already available for all the
13
13
  platforms supported as a bundled package, i.e:
14
14
 
15
15
  Debian/Ubuntu:
@@ -17,7 +17,8 @@ platforms supported as a bundled package, i.e:
17
17
  Mac OS X:
18
18
  $ brew install jsvc
19
19
 
20
- Those binaries are also available in the Apache distribution directory:
20
+ Those binaries are also available in the Apache distribution directory, if
21
+ you install it from this directory you must ensure it's in your path:
21
22
 
22
23
  http://www.apache.org/dist/commons/daemon/binaries/1.0.3/
23
24
 
data/init.d/trinidad.erb CHANGED
@@ -64,6 +64,8 @@ $JSVC_ARGS_EXTRA \
64
64
  STOP_COMMAND="$JSVC $JSVC_ARGS -stop $MAIN_CLASS"
65
65
  START_COMMAND="$JSVC $JSVC_ARGS -cp $CLASSPATH $JAVA_PROPS $JAVA_OPTS $MAIN_CLASS $RUBY_SCRIPT $TRINIDAD_OPTS"
66
66
 
67
+ cd $APP_PATH || exit 1
68
+
67
69
  case "$1" in
68
70
  start)
69
71
  if [ -e "$PIDFILE" ]; then
@@ -117,7 +119,7 @@ case "$1" in
117
119
  fi
118
120
  ;;
119
121
  *)
120
- echo "Unrecognised command. Usage trinidad-daemon [ start | stop | restart ]"
122
+ echo "Unrecognised command. Usage trinidad [ start | stop | restart ]"
121
123
  ;;
122
124
  esac
123
125
 
@@ -3,7 +3,7 @@ require 'trinidad'
3
3
 
4
4
  module Trinidad
5
5
  module Daemon
6
- VERSION = '0.3.0'
6
+ VERSION = '0.3.1'
7
7
 
8
8
  def init
9
9
  end
@@ -19,6 +19,7 @@ module Trinidad
19
19
  end
20
20
 
21
21
  def stop
22
+ @server.tomcat.stop
22
23
  @server.tomcat.destroy
23
24
  end
24
25
 
@@ -10,14 +10,14 @@ module Trinidad
10
10
  end
11
11
 
12
12
  def configure
13
- @app_path = File.expand_path(ask('Application path?'))
14
- @trinidad_options = ask('Trinidad options?', '-e production')
15
- @jsvc = ask('Jsvc path?', `which jsvc`.chomp)
16
- @java_home = ask('Java home?', default_java_home)
17
- @jruby_home = ask('JRuby home?', default_jruby_home)
18
- @output_path = ask('init.d output path?', '/etc/init.d')
19
- @pid_file = ask('pid file?', '/var/run/trinidad/trinidad.pid')
20
- @log_file = ask('log file?', '/var/log/trinidad/trinidad.log')
13
+ @app_path = ask_path('Application path?')
14
+ @trinidad_options = ask('Trinidad options?', '-e production')
15
+ @jsvc = ask_path('Jsvc path?', `which jsvc`.chomp)
16
+ @java_home = ask_path('Java home?', default_java_home)
17
+ @jruby_home = ask_path('JRuby home?', default_jruby_home)
18
+ @output_path = ask_path('init.d output path?', '/etc/init.d')
19
+ @pid_file = ask_path('pid file?', '/var/run/trinidad/trinidad.pid')
20
+ @log_file = ask_path('log file?', '/var/log/trinidad/trinidad.log')
21
21
 
22
22
  @trinidad_daemon_path = File.expand_path('../../trinidad_daemon.rb', __FILE__)
23
23
  @jars_path = File.expand_path('../../../trinidad-libs', __FILE__)
@@ -33,8 +33,8 @@ module Trinidad
33
33
  file.write(daemon)
34
34
  end
35
35
 
36
- puts "Moving trinidad-daemon.sh to #{@output_path}"
37
- `cp #{tmp_file} #{@output_path}`
36
+ puts "Moving trinidad to #{@output_path}"
37
+ `cp #{tmp_file} #{@output_path} && chmod u+x #{@output_path}`
38
38
  puts 'Done.'
39
39
  end
40
40
 
@@ -47,6 +47,10 @@ module Trinidad
47
47
  Java::JavaLang::System.get_property("java.home")
48
48
  end
49
49
 
50
+ def ask_path(question, default = nil)
51
+ File.expand_path(ask(question, default))
52
+ end
53
+
50
54
  def ask(question, default = nil)
51
55
  return nil if not @stdin.tty?
52
56
 
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'trinidad_daemon'
16
- s.version = '0.3.0'
17
- s.date = '2010-10-13'
16
+ s.version = '0.3.1'
17
+ s.date = '2010-11-04'
18
18
  s.rubyforge_project = 'trinidad_daemon'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
metadata CHANGED
@@ -3,89 +3,93 @@ name: trinidad_daemon
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
- - 0
7
- - 3
8
- - 0
9
- version: 0.3.0
6
+ - 0
7
+ - 3
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
- - David Calavera
12
+ - David Calavera
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-13 00:00:00 +02:00
17
+ date: 2010-11-04 00:00:00 -07:00
18
18
  default_executable: trinidad_daemon_install
19
19
  dependencies:
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
- segments:
29
- - 0
30
- - 9
31
- - 6
32
- version: 0.9.6
33
- type: :runtime
34
- version_requirements: *id001
20
+ - !ruby/object:Gem::Dependency
21
+ name: trinidad
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 9
30
+ - 6
31
+ version: 0.9.6
32
+ type: :runtime
33
+ version_requirements: *id001
35
34
  description: Trinidad daemon based on Apache Commons Daemon and JRuby-jsvc
36
35
  email: calavera@apache.org
37
36
  executables:
38
- - trinidad_daemon_install
37
+ - trinidad_daemon_install
39
38
  extensions: []
40
39
 
41
40
  extra_rdoc_files:
42
- - README
43
- - LICENSE
41
+ - README
42
+ - LICENSE
44
43
  files:
45
- - History.txt
46
- - LICENSE
47
- - README
48
- - Rakefile
49
- - bin/trinidad_daemon_install
50
- - init.d/trinidad.erb
51
- - lib/trinidad_daemon.rb
52
- - lib/trinidad_daemon/configuration.rb
53
- - trinidad-libs/commons-daemon.jar
54
- - trinidad-libs/jruby-jsvc.jar
55
- - trinidad_daemon.gemspec
44
+ - History.txt
45
+ - LICENSE
46
+ - README
47
+ - Rakefile
48
+ - bin/trinidad_daemon_install
49
+ - init.d/trinidad.erb
50
+ - lib/trinidad_daemon.rb
51
+ - lib/trinidad_daemon/configuration.rb
52
+ - trinidad-libs/commons-daemon.jar
53
+ - trinidad-libs/jruby-jsvc.jar
54
+ - trinidad_daemon.gemspec
56
55
  has_rdoc: true
57
56
  homepage: http://github.com/calavera/trinidad_daemon
58
57
  licenses: []
59
58
 
60
- post_install_message: "\n\
61
- ------------------------------------------------------------------------------------\n\n\
62
- Please now run:\n\n $ jruby -S trinidad_daemon_install\n\n\
63
- to complete the installation.\n\n\
64
- ------------------------------------------------------------------------------------\n\n"
59
+ post_install_message: |+
60
+
61
+ ------------------------------------------------------------------------------------
62
+
63
+ Please now run:
64
+
65
+ $ jruby -S trinidad_daemon_install
66
+
67
+ to complete the installation.
68
+
69
+ ------------------------------------------------------------------------------------
70
+
65
71
  rdoc_options:
66
- - --charset=UTF-8
72
+ - --charset=UTF-8
67
73
  require_paths:
68
- - lib
74
+ - lib
69
75
  required_ruby_version: !ruby/object:Gem::Requirement
70
- none: false
71
76
  requirements:
72
- - - ">="
73
- - !ruby/object:Gem::Version
74
- segments:
75
- - 0
76
- version: "0"
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ segments:
80
+ - 0
81
+ version: "0"
77
82
  required_rubygems_version: !ruby/object:Gem::Requirement
78
- none: false
79
83
  requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- segments:
83
- - 0
84
- version: "0"
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ segments:
87
+ - 0
88
+ version: "0"
85
89
  requirements: []
86
90
 
87
91
  rubyforge_project: trinidad_daemon
88
- rubygems_version: 1.3.7
92
+ rubygems_version: 1.3.6
89
93
  signing_key:
90
94
  specification_version: 2
91
95
  summary: Trinidad daemon based on Apache Commons Daemon