From d3f2766a79d2cd866ebcdacf83e4c26e507728dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 26 Oct 2023 11:08:49 +0200 Subject: [PATCH] Mark the lock-file configuration option as deprecated This is first step in removing the lock-file configuration option, it marks both the `lock-file` configuration directive and -X option to named as deprecated. --- bin/named/named.rst | 2 ++ bin/named/server.c | 9 +++++++++ doc/arm/reference.rst | 4 +++- doc/misc/options | 2 +- lib/isccfg/namedconf.c | 2 +- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/bin/named/named.rst b/bin/named/named.rst index 698ffcdfd1..1c370d8e8d 100644 --- a/bin/named/named.rst +++ b/bin/named/named.rst @@ -203,6 +203,8 @@ Options Use of this option overrides the ``lock-file`` option in :iscman:`named.conf`. If set to ``none``, the lock file check is disabled. + This option has been deprecated and will be removed in the next release. + Signals ~~~~~~~ diff --git a/bin/named/server.c b/bin/named/server.c index 15bcfa7ffa..24b77fa59e 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -8171,6 +8171,11 @@ check_lockfile(named_server_t *server, const cfg_obj_t *config, NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING, "'lock-file' has no effect " "because the server was run with -X"); + isc_log_write( + named_g_lctx, NAMED_LOGCATEGORY_GENERAL, + NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING, + "-X option has been deprecated and will be " + "removed in the a release"); if (named_g_defaultlockfile != NULL) { server->lockfile = isc_mem_strdup( server->mctx, named_g_defaultlockfile); @@ -8185,6 +8190,10 @@ check_lockfile(named_server_t *server, const cfg_obj_t *config, filename); } } else if (named_g_forcelock && named_g_defaultlockfile != NULL) { + isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL, + NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING, + "-X option has been deprecated and will be " + "removed in the a release"); server->lockfile = isc_mem_strdup(server->mctx, named_g_defaultlockfile); } diff --git a/doc/arm/reference.rst b/doc/arm/reference.rst index 0ca6ac1164..74645a4638 100644 --- a/doc/arm/reference.rst +++ b/doc/arm/reference.rst @@ -1477,9 +1477,11 @@ default is used. on exit. If not specified, the default is ``named.memstats``. .. namedconf:statement:: lock-file - :tags: server + :tags: deprecated :short: Sets the pathname of the file on which :iscman:`named` attempts to acquire a file lock when starting for the first time. + This option is deprecated and will be removed in a future release. + This is the pathname of a file on which :iscman:`named` attempts to acquire a file lock when starting for the first time; if unsuccessful, the server terminates, under the assumption that another server diff --git a/doc/misc/options b/doc/misc/options index 18a51d8609..27290c25b2 100644 --- a/doc/misc/options +++ b/doc/misc/options @@ -164,7 +164,7 @@ options { listen-on [ port ] [ tls ] [ http ] { ; ... }; // may occur multiple times listen-on-v6 [ port ] [ tls ] [ http ] { ; ... }; // may occur multiple times lmdb-mapsize ; - lock-file ( | none ); + lock-file ( | none ); // deprecated managed-keys-directory ; masterfile-format ( raw | text ); masterfile-style ( full | relative ); diff --git a/lib/isccfg/namedconf.c b/lib/isccfg/namedconf.c index 348be0f592..4eb9b47e2e 100644 --- a/lib/isccfg/namedconf.c +++ b/lib/isccfg/namedconf.c @@ -1269,7 +1269,7 @@ static cfg_clausedef_t options_clauses[] = { CFG_CLAUSEFLAG_OBSOLETE }, { "listen-on", &cfg_type_listenon, CFG_CLAUSEFLAG_MULTI }, { "listen-on-v6", &cfg_type_listenon, CFG_CLAUSEFLAG_MULTI }, - { "lock-file", &cfg_type_qstringornone, 0 }, + { "lock-file", &cfg_type_qstringornone, CFG_CLAUSEFLAG_DEPRECATED }, { "managed-keys-directory", &cfg_type_qstring, 0 }, { "match-mapped-addresses", &cfg_type_boolean, 0 }, { "max-rsa-exponent-size", &cfg_type_uint32, 0 },