# frozen_string_literal: true # Requirements # ======================================================================= # Stdlib # ----------------------------------------------------------------------- # Deps # ----------------------------------------------------------------------- require 'plist' require 'fileutils' # Project / Package # ----------------------------------------------------------------------- # Refinements # ======================================================================= require 'nrser/refinements/types' using NRSER::Types # Definitions # ======================================================================= # An server {Locd::Agent} (HTTP only at the moment) that the proxy can # route requests to. # class Locd::Agent::RotateLogs < Locd::Agent::Job # Mixins # ============================================================================ include Locd::Agent::System # Class Methods # ========================================================================== # @return [String] # The non-namespace part of the log rotator agent's label. # def self.label_name "rotate_logs" end # Not much to explain here. # # @return [String] # def self.default_cmd_template "{bin} rotate-logs run" end # .cmd_template def self.default_start_interval NRSER.deep_symbolize_keys Locd.config[:rotate_logs, :start_interval] end # Patch in {.default_cmd_template} as, well, the default for `cmd_template`. # # @param cmd_template: (see Locd::Agent.render_cmd) # # @param **kwds (see Locd::Agent::System::ClassMethods#default_write_kwds) # # @return (see Locd::Agent::System::ClassMethods#default_write_kwds) # def self.default_write_kwds cmd_template: self.default_cmd_template, start_interval: self.default_start_interval, **kwds super \ cmd_template: cmd_template, start_interval: start_interval, **kwds end end # class Locd::Agent::RotateLogs