Multiple named on 1 machine

Mark.Andrews at nominum.com Mark.Andrews at nominum.com
Sat Sep 23 21:25:37 UTC 2000


> 
> I have 1 physical interface with 2 aliases (total 3 interfaces) on our name
> server.  I have 2 instances of named running on each of the logical
> (virtual) interfaces. When the stats messages go out every hour or so, they
> always go out the physical interface rather the corresponding logical
> interface that they are running on; is there a way to force these message to
> go out a specific interface?  It's just confusing from a logging perspective
> because the physical interfaces ip is looked up and written to our loghost.
> I'd appreciate if anyone would help, I have the named x-fers and notifies
> going out the correct interface, just the hourly stats dumps.. Thanks in
> advance.
> -Arthur D'Alessandro

	I would just get named to log each instance under a different name.

	Mark

Index: src/bin/named/ns_main.c
===================================================================
RCS file: /proj/cvs/isc/bind/src/bin/named/ns_main.c,v
retrieving revision 8.128
diff -u -r8.128 ns_main.c
--- ns_main.c	2000/08/21 07:24:17	8.128
+++ ns_main.c	2000/09/23 21:21:50
@@ -161,6 +161,7 @@
 static	u_int16_t               nsid_c1, nsid_c2, nsid_c3;
 static	u_int16_t               nsid_state2;
 static	int                     nsid_algorithm;
+static	char *			logname = NULL;
 
 typedef void (*handler)(void);
 static	int			needs = 0, needs_exit = 0;
@@ -208,7 +210,7 @@
 static void
 usage() {
 	fprintf(stderr,
-"Usage: named [-d #] [-q] [-r] [-v] [-f] [-p port] [[-b|-c] configfile]\n");
+"Usage: named [-d #] [-l logname] [-q] [-r] [-v] [-f] [-p port]\n");
 #ifdef CAN_CHANGE_ID
 	fprintf(stderr,
 "             [-u (username|uid)] [-g (groupname|gid)]\n");
@@ -217,6 +219,8 @@
 	fprintf(stderr,
 "             [-t directory]\n");
 #endif
+	fprintf(stderr,
+"             [[-b|-c] configfile]\n");
 	exit(1);
 }
 
@@ -263,7 +267,7 @@
 	saved_argv[argc] = NULL;
 	/* XXX we need to free() this for clean shutdowns. */
 
-	while ((ch = getopt(argc, argv, "b:c:d:g:p:t:u:vw:qrf")) != -1) {
+	while ((ch = getopt(argc, argv, "b:c:d:g:l:p:t:u:vw:qrf")) != -1) {
 		switch (ch) {
 		case 'b':
 		case 'c':
@@ -327,6 +331,10 @@
 			fprintf(stdout, "%s\n", Version);
 			exit(0);
 
+		case 'l':
+			logname = savestr(optarg, 1);
+			break;
+
 #ifdef CAN_CHANGE_ID
 		case 'u':
 			user_name = savestr(optarg, 1);
@@ -444,9 +452,9 @@
 	n |= LOG_CONS;
 #endif
 #ifdef SYSLOG_42BSD
-	openlog("named", n);
+	openlog(logname ? logname : "named", n);
 #else
-	openlog("named", n, LOG_DAEMON);
+	openlog(logname ? logname : "named", n, LOG_DAEMON);
 #endif
 
 	init_logging();
@@ -2561,6 +2590,8 @@
 	if (chroot_dir != NULL)
 		freestr(chroot_dir);
 	chroot_dir = NULL;
+	if (logname != NULL)
+		freestr(logname);
 	if (nsid_pool != NULL)
 		memput(nsid_pool, 0x10000 * (sizeof(u_int16_t)));
 	nsid_pool = NULL;
--
Mark Andrews, Nominum Inc.
1 Seymour St., Dundas Valley, NSW 2117, Australia
PHONE: +61 2 9871 4742                 INTERNET: Mark.Andrews at nominum.com



More information about the bind-users mailing list