For version 0.8.0:
------------------
+* provide a way to check configuration for errors (dinitcheck command) [DONE]
* Easy way to reload service description (including if service is running, where possible).
-* provide a way to check configuration for errors (dinitcheck command) [In progress]
- - man page
- - circular dependency checks
* report process launch failure reason (stage & errno) via dinitctl.
* "chain-to" can result in an unbreakable loop if the chain is circular. Chained services should not be
started during shutdown to prevent this (also avoids a race condition where the chained service is left
running when everything else has shutdown).
* Show "activated" state in "dinitctl list" output
+For version 0.9.+:
+------------------
+* Service description sanity checks:
+ - Service type not specified
+ - maybe default to 'internal' if command not specified
+ - service command not specified
+ - errors should also be reported by dinitcheck
+
For version 1.0:
----------------
* Service description parse errors should report line number
return std::find(vec.begin(), vec.end(), elem) != vec.end();
}
+static bool errors_found = false;
+
int main(int argc, char **argv)
{
using namespace std;
}
catch (service_load_exc &exc) {
std::cerr << "Unable to load service '" << name << "': " << exc.exc_description << "\n";
+ errors_found = true;
}
}
}
if (!service_chain.empty()) {
+ errors_found = true;
std::cerr << "Found dependency cycle:\n";
for (auto chain_link : service_chain) {
std::cerr << " " << std::get<0>(chain_link)->name << " ->\n";
// TODO additional: check chain-to, other lint
- return 0;
+ return errors_found ? EXIT_FAILURE : EXIT_SUCCESS;
}
static void report_service_description_exc(service_description_exc &exc)
{
std::cerr << "Service '" << exc.service_name << "': " << exc.exc_description << "\n";
+ errors_found = true;
}
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";
+ errors_found = true;
}
static void report_dir_error(const char *service_name, const std::string &dirpath)
{
std::cerr << "Service '" << service_name << "', error reading dependencies from directory " << dirpath
<< ": " << strerror(errno) << "\n";
+ errors_found = true;
}
// Process a dependency directory - filenames contained within correspond to service names which