Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Apr 2012 13:57:45 GMT
From:      Andrew Pantyukhin <infofarmer@FreeBSD.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/167203: [patch] make cron(8) use just "cron" when syslogging
Message-ID:  <201204221357.q3MDvjwZ002426@red.freebsd.org>
Resent-Message-ID: <201204221400.q3ME0hhY027259@freefall.freebsd.org>

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

>Number:         167203
>Category:       bin
>Synopsis:       [patch] make cron(8) use just "cron" when syslogging
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 22 14:00:43 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Pantyukhin
>Release:        FreeBSD 9.0-STABLE
>Organization:
>Environment:
FreeBSD z1.zvq.me 9.0-STABLE FreeBSD 9.0-STABLE #15 r234035: Sun Apr  8 15:05:22 UTC 2012     root@z1:/usr/obj/usr/src/sys/GENVIMG  amd64
>Description:
cron(8) is one of the rare services that puts something complicated in
ident (aka progname aka programname)  field of the syslog messages it
sends: /usr/sbin/cron[PID]. Attached patch changes it to
just "cron" to ease filtering with stock and third-party syslog
daemons, expecting no ":", "[", and "/" in the field.
>How-To-Repeat:

>Fix:
Patch attached.

Patch attached with submission follows:

Index: usr.sbin/cron/lib/misc.c
===================================================================
--- usr.sbin/cron/lib/misc.c	(revision 234571)
+++ usr.sbin/cron/lib/misc.c	(working copy)
@@ -452,9 +452,9 @@
 		 * print the pid ourselves.
 		 */
 # ifdef LOG_DAEMON
-		openlog(ProgramName, LOG_PID, LOG_CRON);
+		openlog("cron", LOG_PID, LOG_CRON);
 # else
-		openlog(ProgramName, LOG_PID);
+		openlog("cron", LOG_PID);
 # endif
 		syslog_open = TRUE;		/* assume openlog success */
 	}


>Release-Note:
>Audit-Trail:
>Unformatted:



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