2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

The option for disabling the PID file is now pid-file none, not pid-file "none"

This commit is contained in:
Andreas Gustafsson
2001-10-16 20:04:41 +00:00
parent 64ea5fd972
commit 8d2b885018
4 changed files with 54 additions and 10 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.c,v 1.349 2001/10/08 07:46:06 marka Exp $ */
/* $Id: server.c,v 1.350 2001/10/16 20:04:36 gson Exp $ */
#include <config.h>
@@ -2138,7 +2138,10 @@ load_configuration(const char *filename, ns_server_t *server,
obj = NULL;
if (ns_config_get(maps, "pid-file", &obj) == ISC_R_SUCCESS)
ns_os_writepidfile(cfg_obj_asstring(obj));
if (cfg_obj_isvoid(obj))
ns_os_writepidfile(NULL);
else
ns_os_writepidfile(cfg_obj_asstring(obj));
else if (ns_g_lwresdonly)
ns_os_writepidfile(lwresd_g_defaultpidfile);
else

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: os.c,v 1.53 2001/10/13 20:13:53 halley Exp $ */
/* $Id: os.c,v 1.54 2001/10/16 20:04:38 gson Exp $ */
#include <config.h>
#include <stdarg.h>
@@ -479,8 +479,9 @@ ns_os_writepidfile(const char *filename) {
cleanup_pidfile();
if (strcmp(filename, "none") == 0)
if (filename == NULL)
return;
len = strlen(filename);
pidfile = malloc(len + 1);
if (pidfile == NULL) {

View File

@@ -2,7 +2,7 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
"http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd">
<!-- File: $Id: Bv9ARM-book.xml,v 1.166 2001/10/15 18:20:22 gson Exp $ -->
<!-- File: $Id: Bv9ARM-book.xml,v 1.167 2001/10/16 20:04:40 gson Exp $ -->
<book>
<title>BIND 9 Administrator Reference Manual</title>
@@ -2913,9 +2913,11 @@ the default is <filename>named.memstats</filename>.</para>
<listitem><para>The pathname of the file the server writes its process ID
in. If not specified, the default is <filename>/var/run/named.pid</filename>.
The pid-file is used by programs that want to send signals to the running
nameserver. If the the <command>pid-file</command> is the keyword
<userinput>"none"</userinput> then no file will be written and any
existing one will be removed.</para>
nameserver. Specifying <command>pid-file none;</command> disables the
use of a PID file &mdash; no file will be written and any
existing one will be removed. Note that <command>none</command>
is a keyword, not a file name, and therefore is not enclosed in
double quotes.</para>
</listitem></varlistentry>
<varlistentry><term><command>statistics-file</command></term>

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: parser.c,v 1.79 2001/10/12 22:00:31 gson Exp $ */
/* $Id: parser.c,v 1.80 2001/10/16 20:04:41 gson Exp $ */
#include <config.h>
@@ -271,6 +271,9 @@ static isc_result_t
create_string(cfg_parser_t *pctx, const char *contents, const cfg_type_t *type,
cfg_obj_t **ret);
static isc_result_t
parse_qstring(cfg_parser_t *pctx, const cfg_type_t *type, cfg_obj_t **ret);
static void
free_string(cfg_parser_t *pctx, cfg_obj_t *obj);
@@ -775,6 +778,41 @@ static cfg_type_t cfg_type_transferformat = {
&transferformat_enums
};
/*
* The special keyword "none", as used in the pid-file option.
*/
static void
print_none(cfg_printer_t *pctx, cfg_obj_t *obj) {
UNUSED(obj);
print(pctx, "none", 4);
}
static cfg_type_t cfg_type_none = {
"none", NULL, print_none, &cfg_rep_void, NULL
};
/*
* A quoted string or the special keyword "none". Used in the pid-file option.
*/
static isc_result_t
parse_qstringornone(cfg_parser_t *pctx, const cfg_type_t *type,
cfg_obj_t **ret)
{
isc_result_t result;
CHECK(cfg_gettoken(pctx, QSTRING));
if (pctx->token.type == isc_tokentype_string &&
strcasecmp(pctx->token.value.as_pointer, "none") == 0)
return (create_cfgobj(pctx, &cfg_type_none, ret));
cfg_ungettoken(pctx);
return (parse_qstring(pctx, type, ret));
cleanup:
return (result);
}
static cfg_type_t cfg_type_qstringornone = {
"qstringornone", parse_qstringornone, NULL, NULL, NULL };
/*
* Clauses that can be found within the top level of the named.conf
* file only.
@@ -828,7 +866,7 @@ options_clauses[] = {
{ "memstatistics-file", &cfg_type_qstring, 0 },
{ "multiple-cnames", &cfg_type_boolean, CFG_CLAUSEFLAG_OBSOLETE },
{ "named-xfer", &cfg_type_qstring, CFG_CLAUSEFLAG_OBSOLETE },
{ "pid-file", &cfg_type_qstring, 0 },
{ "pid-file", &cfg_type_qstringornone, 0 },
{ "port", &cfg_type_uint32, 0 },
{ "random-device", &cfg_type_qstring, 0 },
{ "recursive-clients", &cfg_type_uint32, 0 },