services) and add an accessor method for desired_state.
// TODO write a destructor
+ // Get the current service state.
ServiceState getState() noexcept
{
return service_state;
}
+
+ // Get the target (aka desired) state.
+ ServiceState getTargetState() noexcept
+ {
+ return desired_state;
+ }
// Set logfile, should be done before service is started
void setLogfile(string logfile)
{
ServiceRecord *record = findService(name);
if (record == nullptr) {
- loadServiceRecord(name.c_str());
+ record = loadServiceRecord(name.c_str());
}
return record;
}