fluentd-ui 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fluentd-ui might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0331a441430ebf79173a5f487edb2a3c27e39153
4
- data.tar.gz: f163ed82b19a95b3855e9b4498bab294464253b6
3
+ metadata.gz: f8e87a0be85a9ca53be34f2ea4f3fcc17dbbe20a
4
+ data.tar.gz: a837258d2293575fc3f976bf225db6d9454a9d47
5
5
  SHA512:
6
- metadata.gz: e220e3a0da1426600ae7ff2a9b17ad69b42da407a1f21ef67f489dfe87ec75a702dc9b3ede54273350f555b71bc716322d54d548edb2c31f493f122b0dce1dfa
7
- data.tar.gz: 3d6c95420e6981e516806ee6da6922ead65d08548d554b593a0c50d4ae269d5cd7e5c27d6c607bdab7d0d3132b3c56041930b01e1c82c8583b7f55dce4c5f7c7
6
+ metadata.gz: 01aa81513fdf9a404674c5208c56711824f3a2dcafb6aa940070b55913d6bab941dc17ad1a38781e832a7efe459ccc2497aff3262d8908061f395241770f5834
7
+ data.tar.gz: 07c8a506731321b25714cc4c6ac510227f597e7590141080849fae87ca1d82d349c9f1793496f2a74223af614ef02dde1ef434d39e3987f35bb5cf30a078a343
data/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ Release 0.3.3 - 2014/11/11
2
+
3
+ * [fixed] td-agent detection on Mac OS X
4
+
5
+
1
6
  Release 0.3.2 - 2014/11/10
2
7
 
3
8
  * [fixed] Auto update fluentd-ui feature
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluentd-ui (0.3.2)
4
+ fluentd-ui (0.3.3)
5
5
  addressable
6
6
  bundler
7
7
  draper (~> 1.3)
@@ -2,7 +2,7 @@
2
2
 
3
3
  module ApplicationHelper
4
4
  def has_td_agent_system?
5
- File.exist?("/etc/init.d/td-agent")
5
+ File.exist?("/etc/init.d/td-agent") || File.exist?("/opt/td-agent/embedded/bin/fluentd")
6
6
  end
7
7
 
8
8
  def fluentd_ui_logo
@@ -96,6 +96,14 @@ class Fluentd
96
96
  ensure
97
97
  io && io.close
98
98
  end
99
+
100
+ def detached_command(cmd)
101
+ Bundler.with_clean_env do
102
+ pid = spawn(cmd)
103
+ Process.detach(pid)
104
+ end
105
+ sleep 1 # NOTE/FIXME: too early return will be caused incorrect status report, "sleep 1" is a adhoc hack
106
+ end
99
107
  end
100
108
  end
101
109
  end
@@ -12,32 +12,15 @@ class Fluentd
12
12
  }
13
13
  end
14
14
 
15
- def start
16
- detached_command('/etc/init.d/td-agent start')
17
- end
18
-
19
- def stop
20
- detached_command('/etc/init.d/td-agent stop')
21
- end
22
-
23
- def restart
24
- # NOTE: td-agent has no reload command
25
- # https://github.com/treasure-data/td-agent/blob/master/debian/td-agent.init#L156
26
- detached_command('/etc/init.d/td-agent restart')
27
- end
28
-
29
15
  def version
30
16
  `/usr/sbin/td-agent --version`.strip
31
17
  end
32
18
 
33
- private
34
-
35
- def detached_command(cmd)
36
- Bundler.with_clean_env do
37
- pid = spawn(cmd)
38
- Process.detach(pid)
39
- end
40
- sleep 1 # NOTE/FIXME: too early return will be caused incorrect status report, "sleep 1" is a adhoc hack
19
+ case FluentdUI.platform
20
+ when :macosx
21
+ include Macosx
22
+ when :unix
23
+ include Unix
41
24
  end
42
25
  end
43
26
  end
@@ -0,0 +1,33 @@
1
+ class Fluentd
2
+ class Agent
3
+ class TdAgent
4
+ module Macosx
5
+
6
+ def start
7
+ detached_command("launchctl load #{plist}") && pid_from_launchctl
8
+ end
9
+
10
+ def stop
11
+ detached_command("launchctl unload #{plist}") && FileUtils.rm(pid_file)
12
+ end
13
+
14
+ def restart
15
+ stop && start
16
+ end
17
+
18
+ private
19
+
20
+ def plist
21
+ '/Library/LaunchDaemons/td-agent.plist'
22
+ end
23
+
24
+ def pid_from_launchctl
25
+ # NOTE: launchctl doesn't make pidfile, so detect pid and store it to pidfile manually
26
+ pid = `launchctl list | grep td-agent | cut -f1`.strip
27
+ return if pid == ""
28
+ File.open(pid_file, "w"){|f| f.write pid }
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,21 @@
1
+ class Fluentd
2
+ class Agent
3
+ class TdAgent
4
+ module Unix
5
+ def start
6
+ detached_command('/etc/init.d/td-agent start')
7
+ end
8
+
9
+ def stop
10
+ detached_command('/etc/init.d/td-agent stop')
11
+ end
12
+
13
+ def restart
14
+ # NOTE: td-agent has no reload command
15
+ # https://github.com/treasure-data/td-agent/blob/master/debian/td-agent.init#L156
16
+ detached_command('/etc/init.d/td-agent restart')
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
data/lib/fluentd-ui.rb CHANGED
@@ -29,4 +29,13 @@ module FluentdUI
29
29
  def self.td_agent_ui?
30
30
  ENV["FLUENTD_UI_TD_AGENT"].present?
31
31
  end
32
+
33
+ def self.platform
34
+ case RbConfig::CONFIG['host_os']
35
+ when /darwin|mac os/
36
+ :macosx
37
+ else # FIXME: windows is unix? :P
38
+ :unix
39
+ end
40
+ end
32
41
  end
@@ -1,3 +1,3 @@
1
1
  module FluentdUI
2
- VERSION = "0.3.2"
2
+ VERSION = "0.3.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluentd-ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro Nakagawa
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-10 00:00:00.000000000 Z
12
+ date: 2014-11-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fluentd
@@ -331,6 +331,8 @@ files:
331
331
  - app/models/fluentd/agent/local_common.rb
332
332
  - app/models/fluentd/agent/remote.rb
333
333
  - app/models/fluentd/agent/td_agent.rb
334
+ - app/models/fluentd/agent/td_agent/macosx.rb
335
+ - app/models/fluentd/agent/td_agent/unix.rb
334
336
  - app/models/fluentd/api.rb
335
337
  - app/models/fluentd/api/http.rb
336
338
  - app/models/fluentd/setting.rb