diff --git a/src/lib66/exec/ssexec_signal.c b/src/lib66/exec/ssexec_signal.c index 7e891ec014c2e76dacdff697b8e33ea821a005ba..5af6347fd1630d3b27c495d5e43ac4698121090a 100644 --- a/src/lib66/exec/ssexec_signal.c +++ b/src/lib66/exec/ssexec_signal.c @@ -241,9 +241,20 @@ int ssexec_signal(int argc, char const *const *argv, ssexec_t *info) for (; *argv ; argv++) { int aresid = service_resolve_array_search(ares, areslen, *argv) ; - if (aresid < 0) - log_die(LOG_EXIT_USER, "service: ", *argv, " not available -- did you parse it?") ; - + /** The service may not be supervised, for example serviceB depends on + * serviceA and serviceB by unsupervised by the user. So it will be ignored + * by the function graph_build_service. In this case, the service does not + * exist at array. + * + * At stop process, just ignore it as it already down anyway */ + if (aresid < 0) { + if (what && data[1] != 'r' || data[1] != 'h') { + log_warn("service: ", *argv, " not available -- ignoring it?") ; + continue ; + } else { + log_die(LOG_EXIT_USER, "service: ", *argv, " not available -- did you parse it?") ; + } + } graph_compute_visit(*argv, visit, list, &graph, &napid, requiredby) ; } diff --git a/src/lib66/exec/ssexec_stop.c b/src/lib66/exec/ssexec_stop.c index f943857adb9889a0acd03b9e6dfc04e488950159..36eba6f408d8d4f4ecebfcb6a78d873d3a5e0f8a 100644 --- a/src/lib66/exec/ssexec_stop.c +++ b/src/lib66/exec/ssexec_stop.c @@ -105,9 +105,16 @@ int ssexec_stop(int argc, char const *const *argv, ssexec_t *info) for (; n < argc ; n++) { int aresid = service_resolve_array_search(ares, areslen, argv[n]) ; - if (aresid < 0) - log_die(LOG_EXIT_USER, "service: ", argv[n], " not available -- did you started it?") ; + /** The service may not be supervised, so it will be ignored by the + * function graph_build_service. In this case, the service does not + * exist at array. + * + * This the stop process, just ignore it as it already down anyway */ + if (aresid < 0) { + log_warn("service: ", argv[n], " is already stopped or unsupervised -- ignoring it?") ; + continue ; + } graph_compute_visit(argv[n], visit, list, &graph, &nservice, 1) ; }