The discovery process did not quit if no modules were not found.
@@ -49,6 +49,9 @@ nxt_discovery_start(nxt_task_t *task, void *data)
rt = task->thread->runtime;
b = nxt_discovery_modules(task, rt->modules);
+ if (nxt_slow_path(b == NULL)) {
+ exit(1);
+ }
main_port = rt->port_by_type[NXT_PROCESS_MAIN];
@@ -97,9 +100,14 @@ nxt_discovery_modules(nxt_task_t *task, const char *path)
ret = glob(path, 0, NULL, &glb);
- if (ret == 0) {
n = glb.gl_pathc;
+ if (ret != 0) {
+ nxt_log(task, NXT_LOG_NOTICE,
+ "no modules matching: \"%s\" found", path);
+ n = 0;
+ }
+
modules = nxt_array_create(mp, n, sizeof(nxt_module_t));
if (modules == NULL) {
goto fail;
@@ -150,7 +158,6 @@ nxt_discovery_modules(nxt_task_t *task, const char *path)
*p++ = ']';
b->mem.free = p;
- }
fail:
