return errors_found ? EXIT_FAILURE : EXIT_SUCCESS;
}
-static void report_service_description_exc(service_description_exc &exc)
+static void report_service_description_err(const std::string &service_name, const std::string &what)
{
- std::cerr << "Service '" << exc.service_name << "': " << exc.exc_description << "\n";
+ std::cerr << "Service '" << service_name << "': " << what << "\n";
errors_found = true;
}
+static void report_service_description_exc(service_description_exc &exc)
+{
+ report_service_description_err(exc.service_name, exc.exc_description);
+}
+
static void report_error(std::system_error &exc, const std::string &service_name)
{
std::cerr << "Service '" << service_name << "', error reading service description: " << exc.what() << "\n";
return nullptr;
}
+ if (settings.service_type != service_type_t::INTERNAL && settings.command.length() == 0) {
+ report_service_description_err(name, "Service command not specified.");
+ }
+
return new service_record(name, settings.depends);
}
Checking service: boot...
Service 'boot': Unknown setting: 'not-valid'.
Service 'boot': run-as: Specified user id contains invalid numeric characters or is outside allowed range.
+Service 'boot': Service command not specified.
Checking service: test1...
Unable to load service 'test1': Service description not found.
One or more errors found.