bin/167203: [patch] make cron(8) use just "cron" when syslogging

Andrew Pantyukhin infofarmer at
Sun Apr 22 14:00:44 UTC 2012

>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
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 22 14:00:43 UTC 2012
>Originator:     Andrew Pantyukhin
>Release:        FreeBSD 9.0-STABLE
FreeBSD 9.0-STABLE FreeBSD 9.0-STABLE #15 r234035: Sun Apr  8 15:05:22 UTC 2012     root at z1:/usr/obj/usr/src/sys/GENVIMG  amd64
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.

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 */


More information about the freebsd-bugs mailing list