mirror of
https://github.com/isc-projects/bind9.git
synced 2026-07-16 02:52:51 -04:00
Print the full path of the working directory in startup log messages
named now prints its initial working directory during startup and the
changed working directory when loading or reloading its configuration
file if it has a valid 'directory' option defined.
(cherry picked from commit fd8e1d161f)
This commit is contained in:
parent
1127b2b3d1
commit
3fc322f07c
1 changed files with 20 additions and 0 deletions
|
|
@ -7052,6 +7052,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_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_SERVER, ISC_LOG_INFO,
|
||||
"the working directory is now '%s'", cwd);
|
||||
}
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
@ -8282,6 +8289,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_g_lctx, 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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue