Class: Fluentd::Agent::FluentdGem

Inherits:
Object
  • Object
show all
Includes:
Common, LocalCommon
Defined in:
app/models/fluentd/agent/fluentd_gem.rb

Instance Attribute Summary

Attributes included from Common

#extra_options

Class Method Summary collapse

Instance Method Summary collapse

Methods included from LocalCommon

#config, #config_append, #config_write, #configuration, #log, #log_tail, #running?

Methods included from Common

#config_file, #errors_since, #initialize, #log_file, #pid_file, #recent_errors, #wait_process_starting_seconds

Class Method Details

.default_optionsObject



7
8
9
10
11
12
13
# File 'app/models/fluentd/agent/fluentd_gem.rb', line 7

def self.default_options
  {
    :pid_file    => "#{ENV["HOME"]}/.fluentd-ui/fluent.pid",
    :log_file    => "#{ENV["HOME"]}/.fluentd-ui/fluent.log",
    :config_file => "#{ENV["HOME"]}/.fluentd-ui/fluent.conf",
  }
end

Instance Method Details

#reloadObject

NOTE: does not used currently, and td-agent has no reload command



37
38
39
40
# File 'app/models/fluentd/agent/fluentd_gem.rb', line 37

def reload # NOTE: does not used currently, and td-agent has no reload command
  return false unless running?
  actual_reload
end

#restartObject

return value is status_after_this_method_called == started



28
29
30
31
32
33
34
35
# File 'app/models/fluentd/agent/fluentd_gem.rb', line 28

def restart
  if running?
    validate_fluentd_options && stop && start
  else
    # NOTE: no path to here from browser operations for now
    start
  end
end

#startObject

return value is status_after_this_method_called == started



16
17
18
19
# File 'app/models/fluentd/agent/fluentd_gem.rb', line 16

def start
  return true if running?
  actual_start
end

#stopObject

return value is status_after_this_method_called == stopped



22
23
24
25
# File 'app/models/fluentd/agent/fluentd_gem.rb', line 22

def stop
  return true unless running?
  actual_stop
end

#versionObject



42
43
44
45
46
# File 'app/models/fluentd/agent/fluentd_gem.rb', line 42

def version
  Bundler.with_clean_env do
    `fluentd --version`.strip
  end
end