Commit Graph

87 Commits

Author SHA1 Message Date
Simon J. Gerraty
7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty
f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Simon J. Gerraty
23090366f7 Sync from head 2012-11-04 02:52:03 +00:00
Maxim Sobolev
7a5c30c5b6 Second attempt to add @every_second keyword support. Due to multiple
requests, default to the previous 60-seconds scheduling method
unless there is any @every_second entries to conserve CPU cycles and
power.

This change also improves scheduling in the default mode by running
as close to the beginning of the minnute as possible by replacing
sleep(3) with nanosleep(2). Previously, the tasks would run anywhere
within the first second of the minute and that offset drifted back
and forth each time cron(8) was engaged.

MFC after:	1 month
2012-10-25 22:54:29 +00:00
Maxim Sobolev
07e9aac098 Revert latest changes to cron, until better version is worked out (I hope).
Requested by:   few
2012-10-17 20:45:48 +00:00
Maxim Sobolev
2543786a37 Add per-second scheduling into the cron(8). Right now it's
only available via the new @every_second shortcut. ENOTIME to
implement crontab(5) format extensions to allow more flexible
scheduling.

In order to address some concerns expressed by Terry Lambert
while discussing the topic few years ago, about per-second cron
possibly causing some bad effects on /etc/crontab by stat()ing
it every second instead of every minute now (i.e. atime update),
only check that database needs to be reloaded on every 60-th
loop run. This should be close enough to the current behaviour.

Add "@every_minute" shortcut while I am here.

MFC after:	1 month
2012-10-15 08:21:49 +00:00
Ed Schouten
902d9eafbf Rework all non-contributed files that use `struct timezone'.
This structure is not part of POSIX. According to POSIX, gettimeofday()
has the following prototype:

	int gettimeofday(struct timeval *restrict tp, void *restrict tzp);

Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is
not used). Remove dead error handling code. Also use NULL for a
nul-pointer instead of integer 0.

While there, change all pieces of code that only use tv_sec to use
time(3), as this provides less overhead.
2012-09-01 14:45:15 +00:00
Marcel Moolenaar
7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
John Baldwin
5cdfc55cab Add a one second sleep before touching the spool directory. If the touch
occurs in the same second as the earlier operations to create the temporary
file and the cron(8) daemon is rescans the spool directory during that
second, then the daemon may miss a cron edit and not properly update its
internal database.

MFC after:	1 month
2012-07-02 20:27:37 +00:00
Glen Barber
f85ad80c6f As cron(8) is started with '-s' by default, timezones that observe
DST should not need to worry about scheduling jobs when the DST time
changes.

Rather than removing the BUGS section in crontab(5) regarding this,
note that disabling '-s' may still cause jobs to be executed twice or
not at all.

PR:		166318
Submitted by:	Florian k Unglaub (f.unglaub%googlemail!com)
MFC After:	1 week
2012-04-28 22:48:00 +00:00
Xin LI
cc427081a7 Drop setuid status while doing file operations to prevent potential
information leak.  This changeset is intended to be a minimal one
to make backports easier.

Reviewed by:	kevlo, remko
MFC after:	1 week
2012-02-27 05:49:00 +00:00
Sean Farley
fd2f39cb85 Since April 2, 2006, Indiana has observed DST.
MFC after:	5 days
2012-01-28 21:06:45 +00:00
Warren Block
df799cbad3 Point out that @reboot runs at every cron startup, not just system
startup.

Discussed on:	hackers@

Approved by:	gjb (mentor)
MFC after:	1 week
2011-11-25 17:41:12 +00:00
Christian Brueffer
0d83258df3 List /var/cron/tabs in FILES and add descriptions for the other entries.
PR:		145912
Submitted by:	Julian H. Stacey <jhs@berklix.com>
Obtained from:	OpenBSD
MFC after:	1 week
2010-05-14 01:25:30 +00:00
Sergey Skvortsov
637fd955fe Fix typo.
Approved by:	ru
2008-12-01 17:39:34 +00:00
Matteo Riondato
90f43da7ad Be more precise and use sizeof(tn)
Pointed out by: glewis@

MFC after:	3 days
2008-11-18 00:39:50 +00:00
Matteo Riondato
d9e5bb5c20 Use WARNS?= instead of WARNS=
MFC after:	3 days
2008-11-18 00:12:15 +00:00
Matteo Riondato
66d48cdafe Make usr.sbin/cron/crontab and usr.sbin/cron/lib WARNS=3 clean
Tested with: make universe

MFC after:	3 days
2008-11-10 06:35:30 +00:00
Matteo Riondato
37f1755cab Revert to previous revision.
I should not commit anything at 3.50 AM.
In addition to danfe's comments, I got others.
I'll work on a better version of the patch.
2008-11-09 09:01:09 +00:00
Matteo Riondato
8037791bf7 Don't leave files in /var/cront/tabs when interrupted
PR:		17363
MFC after:	3 days
2008-11-09 07:34:11 +00:00
Matteo Riondato
2b9f079ca2 Be paranoid and use snprintf
PR:		bin/122137
Submitted by:	Steven Kreuzer <skreuzer@exit2shell.com>
MFC after:	3 days
2008-11-09 06:44:53 +00:00
Matteo Riondato
c11807aca2 Be paranoid and zero out passwd
PR:	122070
Submitted by:	Steven Kreuzer <skreuzer@exit2shell.com>
Reminded by:    gnn@
MFC after:	3 days
2008-11-06 04:53:02 +00:00
Kevin Lo
784bddbc5b Cleanup of userland __P use 2007-11-07 10:53:41 +00:00
Ruslan Ermilov
405a44d326 Use a #define to refer to /etc/crontab. 2006-09-03 17:52:19 +00:00
Brooks Davis
9896de5a67 /etc/crontab is similar enough to parse as correct if you run
"crontab /etc/crontab", but not the same format due to the who field.
Add some limited anti-foot-shooting support and refuse to load
/etc/crontab as someone's crontab.  Users wishing shoot their foot in
this manner may copy /etc/crontab elsewhere. :)

MFC After:	1 week
2006-01-10 05:56:32 +00:00
Christian Brueffer
48193882ad Mention the default value of PATH and that it may be overridden.
Submitted by:	Roman Divacky
MFC after:	3 days
2005-07-31 13:41:23 +00:00
Ruslan Ermilov
36a142c455 Expand contractions. 2005-02-13 23:45:54 +00:00
Ruslan Ermilov
0227791b40 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
Ruslan Ermilov
59a3c79da6 Sort sections. 2005-01-18 20:02:45 +00:00
Ruslan Ermilov
dee651eb15 Introduce the PRECIOUSPROG knob in bsd.prog.mk, similar
to PRECIOUSLIB from bsd.lib.mk.  The side effect of this
is making installing the world under jail(8) possible by
using another knob, NOFSCHG.

Reviewed by:	oliver
2004-11-03 18:01:21 +00:00
Diomidis Spinellis
0cd2e3abe5 Ensure that edits that do not span a clock tick are not lost.
PR:	bin/22612
MT5:	4 weeks
MT4:	2 weeks
2004-09-14 19:01:19 +00:00
Diomidis Spinellis
9a2ef7d172 Refactoring: move two similar code blocks into a seprate function. 2004-09-13 21:04:30 +00:00
Diomidis Spinellis
08e019a888 Fix for the following behavior:
$ crontab -e
[Add an entry with an error in the crontab file.]
crontab: errors in crontab file, can't install
Do you want to retry the same edit? yes
[Exit the editor without any changes.]
crontab: no changes made to crontab
[Entry is lost.]

Now crontab will loop until the error is fixed, or the
user answers no.
2004-09-13 18:39:04 +00:00
Ruslan Ermilov
07bfccd71e Mechanically kill hard sentence breaks. 2004-07-02 23:13:00 +00:00
Ruslan Ermilov
31a06a8e6c Trim whitespace at EOL. 2004-06-04 19:24:21 +00:00
Ruslan Ermilov
b18b186e57 Markup nits. 2004-06-04 19:23:12 +00:00
Tom Rhodes
aaa66740bf Eliminate hard sentence breaks.
General markup fixes (use the .Dq macro).
2004-03-04 19:12:27 +00:00
Tom Rhodes
8030199c71 Discuss the 'MAILTO' option.
PR:		58783
Submitted by:	Marc Silver <marcs@draenor.org>
2004-01-12 20:20:29 +00:00
Hartmut Brandt
b9ff618c3a Mention the fact that our crontab is not fully POSIX.2 conform, because
it doesn't allow the dangerous variant of calling it without any
argument.
2003-10-24 13:02:39 +00:00
Jens Schweikhardt
57bd0fc6e8 english(4) police. 2002-12-27 12:15:40 +00:00
Dima Dorfman
e9d295bf0b Actually use the exitstatus value that we maintain.
PR:		43562
Submitted by:	Marc Olzheim <marcolz@ilse.nl>
2002-10-01 22:59:11 +00:00
Philippe Charnier
7f94b8deee Use `The .Nm utility' 2002-04-20 12:27:18 +00:00
Giorgos Keramidas
4188e02521 Grammar fix: "When at least one of the fields .. matches ...".
MFC after:      3 days
2002-03-24 00:48:07 +00:00
David Malone
377a2e036f Describe the format of the allow and deny files. This is more-or-less
the patch Matthew submitted, but I broke the lines in a more FreeBSD
way and made one small wording change.

PR:		31265
Submitted by:	Matthew D. Fuller <fullermd@over-yonder.net>
MFC after:	3 weeks
2002-03-17 14:03:17 +00:00
Ruslan Ermilov
753d686d34 mdoc(7) police: s/BSD/.Bx/ where appropriate. 2001-08-14 10:01:54 +00:00
Ruslan Ermilov
c75526d5a0 mdoc(7) police: fixed the "new sentence" bogons. 2001-08-10 15:03:10 +00:00
Bill Fumerola
fd522d40d8 fix misspelling introduced in rev 1.14 (sames as -> same as) 2001-07-25 04:13:01 +00:00
David E. O'Brien
90e655ea4e Perform a major cleanup of the usr.sbin Makefiles.
These are not perfectly in agreement with each other style-wise, but they
are orders of orders of magnitude more consistent style-wise than before.
2001-07-20 06:20:32 +00:00
Dima Dorfman
f247324df7 Remove whitespace at EOL. 2001-07-15 08:06:20 +00:00
Brian Somers
7bc6d0158f Fix the type of the NULL arg to execl()
Idea from: Theo de Raadt <deraadt@openbsd.org>
2001-07-09 09:24:06 +00:00