diff --git a/CHANGES b/CHANGES index 17d1535ae8..34a3c33268 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +4325. [func] Add a line to "rndc status" indicating the + hostname and operating system details. [RT #41610] + 4324. [bug] When deleting records from a zone database, interior nodes could be left empty but not deleted, damaging search performance afterward. [RT #40997] diff --git a/bin/named/server.c b/bin/named/server.c index 5a1a5ca983..aec9712637 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -8924,7 +8924,7 @@ ns_server_status(ns_server_t *server, isc_buffer_t **text) { const char *ob = "", *cb = "", *alt = ""; char boottime[ISC_FORMATHTTPTIMESTAMP_SIZE]; char configtime[ISC_FORMATHTTPTIMESTAMP_SIZE]; - char line[1024]; + char line[1024], hostname[256]; if (ns_g_server->version_set) { ob = " ("; @@ -8955,6 +8955,13 @@ ns_server_status(ns_server_t *server, isc_buffer_t **text) { ns_g_description, ns_g_srcid, ob, alt, cb); CHECK(putstr(text, line)); + result = ns_os_gethostname(hostname, sizeof(hostname)); + if (result != ISC_R_SUCCESS) + strlcpy(hostname, "localhost", sizeof(hostname)); + snprintf(line, sizeof(line), "running on %s: %s\n", + hostname, ns_os_uname()); + CHECK(putstr(text, line)); + snprintf(line, sizeof(line), "boot time: %s\n", boottime); CHECK(putstr(text, line)); diff --git a/bin/tests/system/rndc/tests.sh b/bin/tests/system/rndc/tests.sh index c001ec4dd6..21209885a2 100644 --- a/bin/tests/system/rndc/tests.sh +++ b/bin/tests/system/rndc/tests.sh @@ -441,4 +441,11 @@ $RNDC -s 10.53.0.5 -p 9953 -c ../common/rndc.conf reconfig > /dev/null 2>&1 && r if [ $ret != 0 ]; then echo "I:failed"; fi status=`expr $status + $ret` +echo "I:test rndc status shows running on" +ret=0 +$RNDC -s 10.53.0.5 -p 9953 -c ../common/rndc.conf status > rndc.output /dev/null 2>&1 || ret=1 +grep "^running on " rndc.output > /dev/null || ret=1 +if [ $ret != 0 ]; then echo "I:failed"; fi +status=`expr $status + $ret` + exit $status