Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/cron/dist apply our changes.



details:   https://anonhg.NetBSD.org/src/rev/936999bd5c2c
branches:  trunk
changeset: 754626:936999bd5c2c
user:      christos <christos%NetBSD.org@localhost>
date:      Thu May 06 18:53:17 2010 +0000

description:
apply our changes.

diffstat:

 external/bsd/cron/dist/CONVERSION   |    2 +-
 external/bsd/cron/dist/Makefile     |    2 +-
 external/bsd/cron/dist/config.h     |   28 +-
 external/bsd/cron/dist/cron.8       |  199 ++++++++-----
 external/bsd/cron/dist/cron.c       |  104 +++---
 external/bsd/cron/dist/cron.h       |    2 +
 external/bsd/cron/dist/crontab.1    |   21 +-
 external/bsd/cron/dist/crontab.5    |  473 +++++++++++++++++++++----------
 external/bsd/cron/dist/crontab.c    |  527 +++++++++++++++++++++--------------
 external/bsd/cron/dist/database.c   |   32 +-
 external/bsd/cron/dist/do_command.c |  270 ++++++++++-------
 external/bsd/cron/dist/entry.c      |  113 +++++-
 external/bsd/cron/dist/env.c        |   37 +-
 external/bsd/cron/dist/externs.h    |    6 +-
 external/bsd/cron/dist/funcs.h      |   19 +-
 external/bsd/cron/dist/globals.h    |    6 +-
 external/bsd/cron/dist/job.c        |   52 +++-
 external/bsd/cron/dist/macros.h     |   19 +-
 external/bsd/cron/dist/misc.c       |  269 +++++------------
 external/bsd/cron/dist/pathnames.h  |    7 +
 external/bsd/cron/dist/popen.c      |   50 +-
 external/bsd/cron/dist/pw_dup.c     |   36 +-
 external/bsd/cron/dist/structs.h    |    2 +
 external/bsd/cron/dist/user.c       |   16 +-
 24 files changed, 1352 insertions(+), 940 deletions(-)

diffs (truncated from 4263 to 300 lines):

diff -r bf3a2e7223fe -r 936999bd5c2c external/bsd/cron/dist/CONVERSION
--- a/external/bsd/cron/dist/CONVERSION Thu May 06 18:50:28 2010 +0000
+++ b/external/bsd/cron/dist/CONVERSION Thu May 06 18:53:17 2010 +0000
@@ -1,4 +1,4 @@
-Id: CONVERSION,v 1.1.1.1 1996/12/16 19:39:48 halley Exp
+Id: CONVERSION,v 1.1.1.1 1996/12/16 19:39:48 halley Exp 
 
 Conversion of BSD 4.[23] crontab files:
 
diff -r bf3a2e7223fe -r 936999bd5c2c external/bsd/cron/dist/Makefile
--- a/external/bsd/cron/dist/Makefile   Thu May 06 18:50:28 2010 +0000
+++ b/external/bsd/cron/dist/Makefile   Thu May 06 18:53:17 2010 +0000
@@ -59,7 +59,7 @@
 INCLUDE                =       -I.
 #INCLUDE       =
 #<<need getopt()>>
-LIBS           =
+LIBS           = -lutil
 #<<optimize or debug?>>
 #CDEBUG                =       -O
 CDEBUG         =       -g
diff -r bf3a2e7223fe -r 936999bd5c2c external/bsd/cron/dist/config.h
--- a/external/bsd/cron/dist/config.h   Thu May 06 18:50:28 2010 +0000
+++ b/external/bsd/cron/dist/config.h   Thu May 06 18:53:17 2010 +0000
@@ -1,3 +1,5 @@
+/*     $NetBSD: config.h,v 1.2 2010/05/06 18:53:17 christos Exp $      */
+
 /* Copyright 1988,1990,1993,1994 by Paul Vixie
  * All rights reserved
  */
@@ -46,19 +48,19 @@
                         * -odi  = Option Deliverymode Interactive
                         * -oem  = Option Errors Mailedtosender
                         * -oi   = Ignore "." alone on a line
-                        * -t    = Get recipient from headers
+                        * -t    = read recipient from header of message
                         */
 #define MAILARG _PATH_SENDMAIL                         /*-*/
 
-/* #define MAILFMT "%s -d %s"                          /*-*/
+/* #define MAILFMT "%s -d %s"                          */
                        /* -d = undocumented but common flag: deliver locally?
                         */
-/* #define MAILARG "/bin/mail",mailto
+/* #define MAILARG "/bin/mail",mailto                  */
 
-/* #define MAILFMT "%s -mlrxto %s"                     /*-*/
-/* #define MAILARG "/usr/mmdf/bin/submit",mailto       /*-*/
+/* #define MAILFMT "%s -mlrxto %s"                     */
+/* #define MAILARG "/usr/mmdf/bin/submit",mailto       */
 
-/* #define MAIL_DATE                           /*-*/
+/* #define MAIL_DATE                           */
                        /* should we include an ersatz Date: header in
                         * generated mail?  if you are using sendmail
                         * as the mailer, it is better to let sendmail
@@ -83,18 +85,20 @@
                        /* if you want cron to capitalize its name in ps
                         * when running a job.  Does not work on SYSV.
                         */
-/*#define CAPITALIZE_FOR_PS            /*-*/
+/* #define CAPITALIZE_FOR_PS           */
 
                        /* if you have a tm_gmtoff member in struct tm.
                         * If not, we will have to compute the value ourselves.
                         */
-/*#define HAVE_TM_GMTOFF               /*-*/
+#define HAVE_TM_GMTOFF         /*-*/
+#define HAVE_FCHOWN            /*-*/
+#define HAVE_UTIMES            /*-*/
 
                        /* if your OS supports a BSD-style login.conf file */
-/*#define LOGIN_CAP                    /*-*/
+/* #define LOGIN_CAP                   */
 
                        /* if your OS supports BSD authentication */
-/*#define BSD_AUTH                     /*-*/
+/*#define BSD_AUTH                     */
 
                        /* Define this to run crontab setgid instead of   
                         * setuid root.  Group access will be used to read
@@ -102,4 +106,6 @@
                         * If this is not defined then crontab and at
                         * must be setuid root.
                         */
-/*#define CRON_GROUP   "crontab"       /*-*/
+/*#define CRON_GROUP   "crontab"       */
+
+#define MAXTABSIZE_DEFAULT     (1024*32)
diff -r bf3a2e7223fe -r 936999bd5c2c external/bsd/cron/dist/cron.8
--- a/external/bsd/cron/dist/cron.8     Thu May 06 18:50:28 2010 +0000
+++ b/external/bsd/cron/dist/cron.8     Thu May 06 18:53:17 2010 +0000
@@ -1,93 +1,142 @@
-.\"/* Copyright 1988,1990,1993,1996 by Paul Vixie
-.\" * All rights reserved
-.\" */
-.\" 
-.\" Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
-.\" Copyright (c) 1997,2000 by Internet Software Consortium, Inc.
-.\"
-.\" Permission to use, copy, modify, and distribute this software for any
-.\" purpose with or without fee is hereby granted, provided that the above
-.\" copyright notice and this permission notice appear in all copies.
-.\"
-.\" THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
-.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-.\" MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
-.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
-.\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.\"
-.\" Id: cron.8,v 1.8 2004/01/23 19:03:32 vixie Exp
+.\"    $NetBSD: cron.8,v 1.2 2010/05/06 18:53:17 christos Exp $
 .\" 
-.TH CRON 8 "10 January 1996""
-.UC 4
-.SH NAME
-cron \- daemon to execute scheduled commands (ISC Cron V4.1)
-.SH SYNOPSIS
-.B cron
-.RB [ \-l
-.IR load_avg ]
-.RB [ \-n ]
-.SH DESCRIPTION
-.I Cron
-should be started from /etc/rc or /etc/rc.local.  It will return immediately,
-so you don't need to start it with '&'.  The \-n option changes this default
-behavior causing it to run in the foreground.  This can be useful when 
-starting it out of init.
-.PP
-.I Cron
-searches /var/cron/tabs for crontab files which are named after accounts in
-/etc/passwd; crontabs found are loaded into memory.
-.I Cron
-also searches for /etc/crontab which is in a different format (see
-.IR crontab (5)).
-.I Cron
+.\" Id: cron.8,v 1.8 2004/01/23 19:03:32 vixie Exp
+.\"
+.Dd May 5, 2010
+.Dt CRON 8
+.Os
+.Sh NAME
+.Nm cron
+.Nd daemon to execute scheduled commands (ISC Cron V4.1)
+.Sh SYNOPSIS
+.Nm
+.Op Fl n
+.Op Fl x Ar debugflags
+.Sh DESCRIPTION
+.Nm
+is normally started during system boot by
+.Xr rc.d 8
+framework, if cron is switched on in
+.Xr rc.conf 5 .
+.Pp
+It will return immediately so you don't have to starti it with '&'.
+.Pp
+.Nm
+searches
+.Pa /var/cron/tabs
+for crontab files which are named after accounts in
+.Pa /etc/passwd .
+Crontabs found are loaded into memory.
+.Nm
+also searches for
+.Pa /etc/crontab
+which is in a different format (see
+.Xr crontab 5 ) .
+.Nm
 then wakes up every minute, examining all stored crontabs, checking each
-command to see if it should be run in the current minute.  When executing
-commands, any output is mailed to the owner of the crontab (or to the user
-named in the MAILTO environment variable in the crontab, if such exists).
-.PP
+command to see if it should be run in the current minute.
+When executing commands, any output is mailed to the owner of the
+crontab (or to the user named in the
+.Ev MAILTO
+environment variable in the crontab, if such exists).
+.Pp
+Events such as
+.Dv START
+and
+.Dv FINISH
+are recorded in the
+.Pa /var/log/cron
+log file with date and time details.
+This information is useful for a number of reasons, such as
+determining the amount of time required to run a particular job.
+By default, root has an hourly job that rotates these log files
+with compression to preserve disk space.
+.Pp
 Additionally,
-.I cron
+.Nm
 checks each minute to see if its spool directory's modtime (or the modtime
 on
-.IR /etc/crontab )
+.Pa /etc/crontab )
 has changed, and if it has,
-.I cron
+.Nm
 will then examine the modtime on all crontabs and reload those which have
-changed.  Thus
-.I cron
-need not be restarted whenever a crontab file is modified.  Note that the
-.IR Crontab (1)
+changed.
+Thus
+.Nm
+need not be restarted whenever a crontab file is modified.
+Note that the
+.Xr crontab 1
 command updates the modtime of the spool directory whenever it changes a
 crontab.
-.SS Daylight Saving Time and other time changes
+.Pp
+The following options are available:
+.Bl -tag -width indent
+.It Fl x
+This  flag turns on some debugging flags.
+.Ar debugflags
+is comma-separated list of debugging flags to turn on.
+If a flag is turned on,
+.Nm
+writes some additional debugging information to system log during
+its work.
+Available debugging flags are:
+.Bl -tag -width proc -compact
+.It Ar sch
+scheduling
+.It Ar proc
+process control
+.It Ar pars
+parsing
+.It Ar load
+database loading
+.It Ar misc
+miscellaneous
+.It Ar test
+test mode - do not actually execute any commands
+.It Ar bit
+show how various bits are set (long)
+.It Ar ext
+print extended debugging information
+.El
+.It Fl n
+Stay in the foreground and don't daemonize
+.Nm .
+.El
+.Sh Daylight Saving Time and other time changes
 Local time changes of less than three hours, such as those caused
 by the start or end of Daylight Saving Time, are handled specially.
 This only applies to jobs that run at a specific time and jobs that
-are run with a granularity greater than one hour.  Jobs that run
-more frequently are scheduled normally.
-.PP
+are run with a granularity greater than one hour.
+Jobs that run more frequently are scheduled normally.
+.Pp
 If time has moved forward, those jobs that would have run in the
 interval that has been skipped will be run immediately.
 Conversely, if time has moved backward, care is taken to avoid running
-jobs twice.
-.PP
+jobs twice.  
+.Pp
 Time changes of more than 3 hours are considered to be corrections to
 the clock or timezone, and the new time is used immediately.
-.SH SIGNALS
-On receipt of a \s-2SIGHUP\s+2, the cron daemon will close and reopen its
-log file.  This is useful in scripts which rotate and age log files.  
+.Sh SIGNALS
+On receipt of a 
+.Dv SIGHUP ,
+the cron daemon will close and reopen its
+log file.
+This is useful in scripts which rotate and age log files.  
 Naturally this is not relevant if cron was built to use
-.IR syslog (3).
-.SH CAVEATS
-In this version of
-.BR cron ,
-/etc/crontab must not be readable or writable by any user other than root.
-In other words, it should be mode 0600.
-.SH "SEE ALSO"
-.IR crontab (1),
-.IR crontab (5)
-.SH AUTHOR
-.nf
-Paul Vixie <vixie%isc.org@localhost>
+.Xr syslog 3.
+.Sh FILES
+.Bl -tag -width /var/cron/tabs -compact
+.It Pa /var/cron/tabs
+.Nm
+spool directory
+.It Pa /etc/crontab



Home | Main Index | Thread Index | Old Index