diff --git a/bin/named/server.c b/bin/named/server.c index 2a61a8cc45..a57f5f5597 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -7033,6 +7033,13 @@ directory_callback(const char *clausename, const cfg_obj_t *obj, void *arg) { return (result); } + char cwd[PATH_MAX]; + if (getcwd(cwd, sizeof(cwd)) == cwd) { + isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER, + ISC_LOG_INFO, "the working directory is now '%s'", + cwd); + } + return (ISC_R_SUCCESS); } @@ -8261,6 +8268,19 @@ load_configuration(const char *filename, named_server_t *server, &named_g_defaults) == ISC_R_SUCCESS); } + /* + * Log the current working directory. + */ + if (first_time) { + char cwd[PATH_MAX]; + if (getcwd(cwd, sizeof(cwd)) == cwd) { + isc_log_write(NAMED_LOGCATEGORY_GENERAL, + NAMED_LOGMODULE_SERVER, ISC_LOG_INFO, + "the initial working directory is '%s'", + cwd); + } + } + /* * Parse the configuration file using the new config code. */