runit-man 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/lib/runit-man/app.rb +10 -7
  2. data/sv/run +3 -1
  3. data/sv/run.erb +2 -0
  4. metadata +2 -2
data/lib/runit-man/app.rb CHANGED
@@ -130,9 +130,16 @@ class RunitMan < Sinatra::Base
130
130
  class << self
131
131
  def register_as_runit_service
132
132
  create_run_script
133
- return if File.symlink?(File.join(RunitMan.all_services_directory, 'runit-man'))
134
- do_cmd("ln -sf #{File.join(GEM_FOLDER, 'sv')} #{File.join(RunitMan.all_services_directory, 'runit-man')}")
135
- do_cmd("ln -sf #{File.join(RunitMan.all_services_directory, 'runit-man')} #{File.join(RunitMan.active_services_directory, 'runit-man')}")
133
+ all_r_dir = File.join(RunitMan.all_services_directory, 'runit-man')
134
+ active_r_dir = File.join(RunitMan.active_services_directory, 'runit-man')
135
+ my_dir = File.join(GEM_FOLDER, 'sv')
136
+ if File.symlink?(all_r_dir)
137
+ File.unlink(all_r_dir)
138
+ end
139
+ File.symlink(my_dir, all_r_dir)
140
+ unless File.symlink?(active_r_dir)
141
+ File.symlink(all_r_dir, active_r_dir)
142
+ end
136
143
  end
137
144
 
138
145
  def enable_view_of(file_location)
@@ -144,10 +151,6 @@ class RunitMan < Sinatra::Base
144
151
  end
145
152
 
146
153
  private
147
- def do_cmd(command)
148
- system(command) or raise "Cannot execute #{command}"
149
- end
150
-
151
154
  def create_run_script
152
155
  script_name = File.join(GEM_FOLDER, 'sv', 'run')
153
156
  File.open(script_name, 'w') do |f|
data/sv/run CHANGED
@@ -1,3 +1,5 @@
1
1
  #!/bin/sh
2
2
  exec 2>&1
3
- exec runit-man -b 0.0.0.0 -p 14230 -a "/etc/service" -f "/etc/sv"
3
+ exec runit-man -b 0.0.0.0 -p 14230 -a "/etc/service" -f "/etc/sv" -v "/etc/radiofeed/grabber_local.cfg"
4
+
5
+ /etc/radiofeed/grabber_local.cfg
data/sv/run.erb CHANGED
@@ -1,3 +1,5 @@
1
1
  #!/bin/sh
2
2
  exec 2>&1
3
3
  exec runit-man<% if server.kind_of?(String) %> -s "<%= server %>"<% end %><% if bind %> -b <%= bind %><% end %> -p <%= port %> -a "<%= active_services_directory %>" -f "<%= all_services_directory %>"<% files_to_view.each do |f| %> -v "<%= f %>"<% end %>
4
+
5
+ <%= files_to_view.join(',') %>
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 5
8
- - 1
9
- version: 1.5.1
8
+ - 2
9
+ version: 1.5.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Akzhan Abdulin