Subject: cron facility missing from syslogd (#419) Index: sbin/syslogd/syslogd.c 2.11BSD Description: The 'cron' facility is missing from syslogd(8). Repeat-By: Add the line: cron.debug /usr/adm/cron to /etc/syslog.conf and then SIGHUP syslogd(8). Observe the error "no such facility" that is emitted. Fix: In the process of (finally) getting the Vixie 'cron' (soon to be released for 2.11BSD) running on 2.11BSD it was seen that messages were being logged to the '/usr/adm/daemonlog' file even though LOG_CRON is defined in sys/syslog.h. Ah, the fix was to add "cron.debug /usr/adm/cron" to syslog.conf. Then 'syslogd' became upset. The fix was to add the 'cron' facility to syslogd(8). At the same time several deprecated facilities were removed. One part of the patch below may not apply cleanly if local modifications have been made to /etc/syslog.conf. Simply add the one line "cron /usr/adm/cron" to the syslog.conf file using the editor of your choice. If local changes have been made to the weekly cleanup script (in /usr/adm/weekly) then that file will have to be patched manually as well. The change is to add the rotation and compression of the 'cron' file BEFORE the HUP signal is sent to syslogd. The Vixie 'cron' (which allows individual users to maintain their own crontab files) will be released "soon" (if not in the next week then it will have to wait until I get back from vacation) wants to log messages with the facility 'LOG_CRON'. Having a separate syslogd file for cron messages obviates the need for cron(8) to maintain its own logfile. To install this update cut where indicated saving to a file (/tmp/419). Then: patch -p0 < /tmp/419 touch /usr/adm/cron cd /usr/src/usr.sbin/syslogd make clean make make install kill `cat /var/run/syslog.pid` /usr/sbin/syslogd As always this and previous updates to 2.11BSD are available via anonymous FTP to either FTP.IIPO.GTEGSC.COM or MOE.2BSD.COM in the directory /pub/2.11BSD. ---------------------------cut here---------------------------- *** /etc/syslog.conf.old Thu Sep 21 08:36:12 1989 --- /etc/syslog.conf Fri Jun 18 21:32:11 1999 *************** *** 3,8 **** --- 3,9 ---- *.err;auth.notice;*.info;kern.debug;local3,local7,mail,daemon,lpr.none /usr/adm/messages + cron.debug /usr/adm/cron lpr.debug /usr/adm/lpd-errs mail.debug /usr/spool/mqueue/syslog mark.debug;daemon.debug /usr/adm/daemonlog *** /usr/adm/weekly.old Sat Nov 16 16:50:27 1996 --- /usr/adm/weekly Mon Jun 21 19:51:18 1999 *************** *** 21,26 **** --- 21,38 ---- mv messages messages.0 cp /dev/null messages chmod 644 messages + + echo "" + echo "Rotating cron:" + cd /usr/adm + mv -f cron.2.Z cron.3.Z + mv -f cron.1.Z cron.2.Z + mv -f cron.0.Z cron.1.Z + mv -f cron cron.0 + compress -f cron.0 + cp /dev/null cron + chmod 644 cron + kill -1 `cat /var/run/syslog.pid` cd / *** /usr/src/etc/syslog.conf.old Thu Sep 21 08:36:12 1989 --- /usr/src/etc/syslog.conf Fri Jun 18 21:39:41 1999 *************** *** 3,8 **** --- 3,9 ---- *.err;auth.notice;*.info;kern.debug;local3,local7,mail,daemon,lpr.none /usr/adm/messages + cron.debug /usr/adm/cron lpr.debug /usr/adm/lpd-errs mail.debug /usr/spool/mqueue/syslog mark.debug;daemon.debug /usr/adm/daemonlog *** /usr/src/sys/h/syslog.h.old Thu Dec 26 13:53:39 1991 --- /usr/src/sys/h/syslog.h Fri Jun 18 21:26:54 1999 *************** *** 30,36 **** * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ! * @(#)syslog.h 8.1.1 (2.11BSD) 1995/04/01 * $Id: syslog.h,v 1.4 1994/08/21 04:42:00 paul Exp $ */ --- 30,36 ---- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ! * @(#)syslog.h 8.1.2 (2.11BSD) 1999/06/18 * $Id: syslog.h,v 1.4 1994/08/21 04:42:00 paul Exp $ */ *************** *** 77,88 **** "debug", LOG_DEBUG, "emerg", LOG_EMERG, "err", LOG_ERR, - "error", LOG_ERR, /* DEPRECATED */ "info", LOG_INFO, "none", INTERNAL_NOPRI, /* INTERNAL */ "notice", LOG_NOTICE, - "panic", LOG_EMERG, /* DEPRECATED */ - "warn", LOG_WARNING, /* DEPRECATED */ "warning", LOG_WARNING, NULL, -1, }; --- 77,85 ---- *************** *** 129,135 **** "mail", LOG_MAIL, "mark", INTERNAL_MARK, /* INTERNAL */ "news", LOG_NEWS, - "security", LOG_AUTH, /* DEPRECATED */ "syslog", LOG_SYSLOG, "user", LOG_USER, "uucp", LOG_UUCP, --- 126,131 ---- *** /usr/src/usr.sbin/syslogd/syslogd.c.old Thu May 27 21:55:56 1999 --- /usr/src/usr.sbin/syslogd/syslogd.c Fri Jun 18 21:28:53 1999 *************** *** 9,15 **** "@(#) Copyright (c) 1983 Regents of the University of California.\n\ All rights reserved.\n"; ! static char sccsid[] = "@(#)syslogd.c 5.13.5 (2.11BSD) 1999/5/27"; #endif /* --- 9,15 ---- "@(#) Copyright (c) 1983 Regents of the University of California.\n\ All rights reserved.\n"; ! static char sccsid[] = "@(#)syslogd.c 5.13.6 (2.11BSD) 1999/6/18"; #endif /* *************** *** 902,915 **** }; struct code PriNames[] = { - "panic", LOG_EMERG, "emerg", LOG_EMERG, "alert", LOG_ALERT, "crit", LOG_CRIT, "err", LOG_ERR, - "error", LOG_ERR, "warn", LOG_WARNING, - "warning", LOG_WARNING, "notice", LOG_NOTICE, "info", LOG_INFO, "debug", LOG_DEBUG, --- 902,912 ---- *************** *** 923,932 **** "mail", LOG_MAIL, "daemon", LOG_DAEMON, "auth", LOG_AUTH, - "security", LOG_AUTH, "mark", LOG_MARK, "syslog", LOG_SYSLOG, "lpr", LOG_LPR, "local0", LOG_LOCAL0, "local1", LOG_LOCAL1, "local2", LOG_LOCAL2, --- 920,929 ---- "mail", LOG_MAIL, "daemon", LOG_DAEMON, "auth", LOG_AUTH, "mark", LOG_MARK, "syslog", LOG_SYSLOG, "lpr", LOG_LPR, + "cron", LOG_CRON, "local0", LOG_LOCAL0, "local1", LOG_LOCAL1, "local2", LOG_LOCAL2, *** /VERSION.old Sun May 30 09:27:25 1999 --- /VERSION Fri Jun 18 20:12:24 1999 *************** *** 1,5 **** ! Current Patch Level: 418 ! Date: May 27, 1999 2.11 BSD ============ --- 1,5 ---- ! Current Patch Level: 419 ! Date: June 18, 1999 2.11 BSD ============