NCM::Component::Systemd::Service¶
NAME¶
NCM::Component::Systemd::Service handles the ncm-systemd units.
Public methods¶
- new
Returns a new object with argument
base(the configuration path) and accepts the following options
- log
A logger instance (compatible withCAF::Object).
- configure
configuregathered the to-be-configured units from theconfigusing thegather_unitsmethod and then takes appropriate actions.
Private methods¶
- set_unconfigured_default
Return the default behaviour for unconfigured units fromncn-systemdand legacyncm-chkconfig.
- gather_configured_units
Gather the list of all configured units from both
ncm-systemdand legacyncm-chkconfiglocation, and take appropriate actions.For any unit defined in both
ncm-systemdandncm-chkconfiglocation, thencm-systemdsettings will be used.Returns a hash reference with key the unit name and value the unit detail.
- gather_current_units
Gather list of current units from both
systemctland legacychkconfigusing resp.unitandchkconfigcurrent_unitsmethods.The hashref
relevant_unitsis used to run minimal set of system commands where possible: e.g. if the hashref represents the configured units and ifunconfiguredisignore, only gathered details for these units.
- process
processtheconfiguredandcurrentunits and return hash references with state and activation changes.It uses the
currentunits to make the required decisions. Unconfigured current units are also processed according theunconfiguredvalue.
- change
Actually make the changes as specified in the hashrefsstatesandacts(which hold the changes to be made to resp. the state and the activity of the units).