class Fluentd
  class Agent
    class TdAgent
      module Unix
        def start
          backup_running_config do
            detached_command('/etc/init.d/td-agent start')
          end
        end

        def stop
          detached_command('/etc/init.d/td-agent stop')
        end

        def restart
          detached_command('/etc/init.d/td-agent restart')
        end
      end
    end
  end
end

class Fluentd
  class Agent
    class TdAgent
      module Unix
        def start
          backup_running_config do
            detached_command("systemctl start td-agent.service")
          end
        end

        def stop
          detached_command("systemctl stop td-agent.service")
        end

        def restart
          detached_command("systemctl restart td-agent.service")
        end

        def reload
          detached_command("systemctl reload td-agent.service")
        end
      end
    end
  end
end

Use systemctl instead of /etc/init.d/td-agent
Use systemctl instead of /etc/init.d/td-agent

Because td-agent3 supports systemd.

Signed-off-by: Kenji Okimoto <7a4b90a0a1e6fc688adec907898b6822ce215e6c@clear-code.com>
