fluentd-ui 0.3.2 → 0.3.3
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.
Potentially problematic release.
This version of fluentd-ui might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/ChangeLog +5 -0
- data/Gemfile.lock +1 -1
- data/app/helpers/application_helper.rb +1 -1
- data/app/models/fluentd/agent/local_common.rb +8 -0
- data/app/models/fluentd/agent/td_agent.rb +5 -22
- data/app/models/fluentd/agent/td_agent/macosx.rb +33 -0
- data/app/models/fluentd/agent/td_agent/unix.rb +21 -0
- data/lib/fluentd-ui.rb +9 -0
- data/lib/fluentd-ui/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8e87a0be85a9ca53be34f2ea4f3fcc17dbbe20a
|
4
|
+
data.tar.gz: a837258d2293575fc3f976bf225db6d9454a9d47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01aa81513fdf9a404674c5208c56711824f3a2dcafb6aa940070b55913d6bab941dc17ad1a38781e832a7efe459ccc2497aff3262d8908061f395241770f5834
|
7
|
+
data.tar.gz: 07c8a506731321b25714cc4c6ac510227f597e7590141080849fae87ca1d82d349c9f1793496f2a74223af614ef02dde1ef434d39e3987f35bb5cf30a078a343
|
data/ChangeLog
CHANGED
data/Gemfile.lock
CHANGED
@@ -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
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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
data/lib/fluentd-ui/version.rb
CHANGED
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.
|
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-
|
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
|