]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/main: log config path and workdir
authorTomas Krizek <tomas.krizek@nic.cz>
Wed, 11 Dec 2019 15:05:12 +0000 (16:05 +0100)
committerPetr Špaček <petr.spacek@nic.cz>
Thu, 19 Dec 2019 08:31:25 +0000 (09:31 +0100)
daemon/engine.c
daemon/main.c

index 473e190207261c763542d19c679bc92b0fff5ad5..ff25b28c6d279eb6ac9245ca8fd3593e9baa2442 100644 (file)
@@ -708,6 +708,11 @@ int engine_load_sandbox(struct engine *engine)
 int engine_loadconf(struct engine *engine, const char *config_path)
 {
        assert(config_path != NULL);
+
+       char cwd[PATH_MAX];
+       get_workdir(cwd, sizeof(cwd));
+       kr_log_verbose("[system] loading config '%s' (workdir '%s')\n", config_path, cwd);
+
        int ret = luaL_dofile(engine->L, config_path);
        if (ret != 0) {
                fprintf(stderr, "%s\n", lua_tostring(engine->L, -1));
index 33c8622f929de85f82214212459b48ab95b6c661..98256c046ca6d65b12bb5aae28785c3aba6a80e8 100644 (file)
@@ -770,7 +770,10 @@ int main(int argc, char **argv)
                if (strcmp(config, "-") == 0) {
                        load_defaults = false;
                } else if (access(config, R_OK) != 0) {
-                       kr_log_error("[system] config '%s': %s\n", config, strerror(errno));
+                       char cwd[PATH_MAX];
+                       get_workdir(cwd, sizeof(cwd));
+                       kr_log_error("[system] config '%s' (workdir '%s'): %s\n",
+                               config, cwd, strerror(errno));
                        return EXIT_FAILURE;
                }
        }