Sha256: 68b0f49921a27fcec81819a74cce78acb61870dc8ff87adcf3d95b64ce388ada

Contents?: true

Size: 817 Bytes

Versions: 23

Compression:

Stored size: 817 Bytes

Contents

class Fluentd
  class Agent
    class TdAgent
      module Macosx
        def start
          backup_running_config do
            detached_command("launchctl load #{plist}") && pid_from_launchctl
          end
        end

        def stop
          detached_command("launchctl unload #{plist}") && FileUtils.rm(pid_file)
        end

        def restart
          dryrun && stop && start
        end

        private

        def plist
          '/Library/LaunchDaemons/td-agent.plist'
        end

        def pid_from_launchctl
          # NOTE: launchctl doesn't make pidfile, so detect pid and store it to pidfile manually
          pid = `launchctl list | grep td-agent | cut -f1`.strip
          return if pid == ""
          File.open(pid_file, "w"){|f| f.write pid }
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
fluentd-ui-1.2.1 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-1.2.0 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-1.1.0 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-1.0.1 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-1.0.0 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-1.0.0.beta.1 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-1.0.0.alpha.3 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-1.0.0.alpha.2 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-1.0.0.alpha.1 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-0.4.5 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-0.4.4 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-0.4.3 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-0.4.2 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-0.4.1 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-0.4.0 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-0.3.21 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-0.3.20 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-0.3.19 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-0.3.18 app/models/fluentd/agent/td_agent/macosx.rb
fluentd-ui-0.3.17 app/models/fluentd/agent/td_agent/macosx.rb