Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jun 2002 14:57:44 -0400
From:      James F.Hranicky <jfh@cise.ufl.edu>
To:        freebsd-stable@freebsd.org
Subject:   Patch: syslogd logs FQDN
Message-ID:  <20020620145744.213f67c2.jfh@cise.ufl.edu>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
I don't know if anyone else would want this, but I'm moving my loghost
to FBSD from Solaris, and have lots of instances of my FQDN in my 
logstats config files, so the easiest thing for me is to have FBSD's
syslogd log the FQDN instead of the short name. Call me lazy.

     -q      Log hostnames with FQDN instead of short names.

----------------------------------------------------------------------
| Jim Hranicky, Senior SysAdmin                   UF/CISE Department |
| E314D CSE Building                            Phone (352) 392-1499 |
| jfh@cise.ufl.edu                      http://www.cise.ufl.edu/~jfh |
----------------------------------------------------------------------

P.S. I'm not subscribed to -stable.
[-- Attachment #2 --]
*** syslogd.c.orig	Thu Jun 20 14:14:04 2002
--- syslogd.c	Thu Jun 20 14:29:41 2002
***************
*** 257,262 ****
--- 257,263 ----
  struct	filed consfile;
  
  int	Debug;			/* debug flag */
+ int	Qualify;		/* Log FQDN instead of short name */
  int	resolve = 1;		/* resolve hostname */
  char	LocalHostName[MAXHOSTNAMELEN];	/* our hostname */
  const char	*LocalDomain;		/* our local domain name */
***************
*** 333,339 ****
  	socklen_t len;
  
  	bindhostname = NULL;
! 	while ((ch = getopt(argc, argv, "46Aa:b:cdf:kl:m:np:P:suv")) != -1)
  		switch (ch) {
  		case '4':
  			family = PF_INET;
--- 334,340 ----
  	socklen_t len;
  
  	bindhostname = NULL;
! 	while ((ch = getopt(argc, argv, "46Aa:b:cdf:kl:m:np:P:qsuv")) != -1)
  		switch (ch) {
  		case '4':
  			family = PF_INET;
***************
*** 384,389 ****
--- 385,393 ----
  		case 'P':		/* path for alt. PID */
  			PidFile = optarg;
  			break;
+ 		case 'q':		/* no network mode */
+ 			Qualify++;
+ 			break;
  		case 's':		/* no network mode */
  			SecureMode++;
  			break;
***************
*** 1255,1262 ****
  		return (ip);
  	}
  	/* XXX Not quite correct, but close enough for government work. */
! 	if ((p = strchr(hname, '.')) && strcasecmp(p + 1, LocalDomain) == 0)
! 		*p = '\0';
  	return (hname);
  }
  
--- 1259,1268 ----
  		return (ip);
  	}
  	/* XXX Not quite correct, but close enough for government work. */
! 	if (!Qualify) {
! 		if ((p = strchr(hname, '.')) && strcasecmp(p + 1, LocalDomain) == 0)
! 			*p = '\0';
! 	}
  	return (hname);
  }
  

[-- Attachment #3 --]
*** syslogd.8.orig	Thu Jun 20 14:52:03 2002
--- syslogd.8	Thu Jun 20 14:54:50 2002
***************
*** 203,208 ****
--- 203,210 ----
  The primary use for this is to place additional log sockets in
  .Pa /var/run/log
  of various chroot filespaces.
+ .It Fl q
+ Log hostnames with FQDN instead of short names.
  .It Fl s
  Operate in secure mode.  Do not log messages from remote machines.  If
  specified twice, no network socket will be opened at all, which also

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020620145744.213f67c2.jfh>