NAME
NCM::Component::Systemd::Service handles the 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 with
CAF::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 from
ncn-systemdand legacy chkconfig. -
gather_configured_units
Gather the list of all configured units from both
ncm-systemdand legacy chkconfig location, and take appropriate actions.For any unit defined in both systemd and chkconfig location, the systemd settings 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.unitand chkconfigcurrent_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 hashrefs
statesandacts(which hold the changes to be made to resp. the state and the activity of the units).