OpenBSD CVS

CVS log for src/usr.sbin/cron/macros.h


[BACK] Up to [local] / src / usr.sbin / cron

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.16 / (download) - annotate - [select for diffs], Sat May 6 23:06:27 2023 UTC (13 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.15: +3 -1 lines
Diff to previous 1.15 (colored)

Support random offsets when using ranges with a step value in cron.
This extends the random range syntax to support step values.  Instead
of choosing a random number between the high and low values, the
field is treated as a range with a random offset less than the step
value.  This can be used to avoid thundering herd problems where
multiple machines contact a server all at the same time via cron jobs.

The syntax is similar to the existing range/step syntax but uses a
random range.  For example, instead of "0-59/10" in the minutes
field, "0~59/10" can be used to run a command every 10 minutes where
the first command starts at a random offset in the range [0,9].
The high and low numbers are optional, "~/10" can be used instead.

Requested by job@, OK phessler@

Revision 1.15 / (download) - annotate - [select for diffs], Thu Nov 12 21:12:05 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.14: +1 -2 lines
Diff to previous 1.14 (colored)

Use absolute paths in pathnames.h.  There is no longer a need to
chdir(2) to the cron dir and cron(8) now changes to / via daemon(3).
We no longer try to create/chmod the spool directories as they
should be set correctly at install time.  The setegid(crontab)
has been moved to open_socket() so it is closer to the chmod(2)
call that needs it.  OK deraadt@ tedu@

Revision 1.14 / (download) - annotate - [select for diffs], Wed Nov 4 20:28:17 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.13: +3 -1 lines
Diff to previous 1.13 (colored)

Change cron from including all headers in every file to only including
what each .c file needs.  I have not removed cron.h since it will
be used in a future clean up of the cron's .h files.  OK nicm@

Revision 1.13 / (download) - annotate - [select for diffs], Mon Oct 26 14:27:41 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.12: +1 -6 lines
Diff to previous 1.12 (colored)

Remove some useless defines and the set_cron_uid() function.
OK jung@

Revision 1.12 / (download) - annotate - [select for diffs], Tue Oct 6 14:58:37 2015 UTC (8 years, 8 months ago) by tedu
Branch: MAIN
Changes since 1.11: +1 -3 lines
Diff to previous 1.11 (colored)

clear out some more legacy code and whatnot

Revision 1.11 / (download) - annotate - [select for diffs], Fri Jan 23 02:37:25 2015 UTC (9 years, 4 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.10: +1 -10 lines
Diff to previous 1.10 (colored)

Remove the OK and ERR macros. They obfuscate the code and don't
help legibility. (unix system calls use 0 for ok, but hundreds of
other projects use 1 to indicate success.) Despite the name, many
system calls (e.g., open) also return not OK values for success.
It also cleans up some weird code like int crontab_fd = OK - 1;
This diff is mechanical in nature. Later I will fix the bugs it reveals.
ok deraadt

Revision 1.10 / (download) - annotate - [select for diffs], Fri Jan 23 01:01:06 2015 UTC (9 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.9: +2 -29 lines
Diff to previous 1.9 (colored)

remove debug code.
I think the level of debug code in cron is excessive for a program
that has reached feature complete. If cron needs to provide more
information to the user about its operational status, I think syslog
would be more appropriate. (The debug flags also disable forking
into the background, so they aren't even that useful for debugging a
live system.)
ok deraadt millert

Revision 1.9 / (download) - annotate - [select for diffs], Wed Jan 14 17:30:53 2015 UTC (9 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.8: +1 -5 lines
Diff to previous 1.8 (colored)

Replace MAXHOSTNAMELEN with HOST_NAME_MAX+1 and MAXNAMLEN with NAME_MAX
and use limits.h instead of sys/param.h.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Nov 23 18:06:49 2013 UTC (10 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.7: +1 -2 lines
Diff to previous 1.7 (colored)

remove unused macro; ok jca

Revision 1.7 / (download) - annotate - [select for diffs], Mon Aug 22 19:32:42 2011 UTC (12 years, 9 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.6: +1 -6 lines
Diff to previous 1.6 (colored)

Use standard EXIT_SUCCESS/EXIT_FAILURE and STD{IN,OUT,ERR}_FILENO
defines instead of using custom macros.  OK deraadt@ gilles@

Revision 1.6 / (download) - annotate - [select for diffs], Thu Jun 17 22:11:55 2004 UTC (19 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.5: +9 -13 lines
Diff to previous 1.5 (colored)

UUpdate ISC copyright year to 2004
Remove unused macros Skip_Line and MkLower
Remove trailing whitespace

Revision 1.5 / (download) - annotate - [select for diffs], Fri Feb 28 16:32:09 2003 UTC (21 years, 3 months ago) by mpech
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

Fix double Debug() usage, for instance, Debug(DPARS|DEXT...)
Make sence if debugging.

millert@ ok

Revision 1.4 / (download) - annotate - [select for diffs], Thu Feb 20 20:38:08 2003 UTC (21 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.3: +5 -11 lines
Diff to previous 1.3 (colored)

Sync with ISC cron-current + my at(1) integration.
The at(1) code is now more tightly integrated into the cron codebase.

Revision 1.3 / (download) - annotate - [select for diffs], Mon Jul 15 19:13:29 2002 UTC (21 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.2: +5 -3 lines
Diff to previous 1.2 (colored)

Move atrun(8) functionality into cron(8) proper.  This fixes the
long-standing annoyance that atrun's granularity is 10 minutes.
Most at jobs run with a 1 minute granularity.  Jobs submitted via
"at now" or "batch" will run immediately.  Includes a rewritten
cron(8) man page.  at(1) will be integrated more closely into
cron at a future date.

Upgrading notes:
    the atrun job in root's crontab should be removed.
    the /var/at/spool directory is no longer used

Revision 1.2 / (download) - annotate - [select for diffs], Tue Feb 20 02:03:19 2001 UTC (23 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1, OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.1: +5 -1 lines
Diff to previous 1.1 (colored)

Turn get_gmtoff into a macro for OSes with tm_gmtoff (like OpenBSD).
Save the GMT offset in a global so cron_sleep can use it.  This means
the offset can only change in set_time() which is really what we want.

Revision 1.1 / (download) - annotate - [select for diffs], Sun Feb 18 19:48:35 2001 UTC (23 years, 3 months ago) by millert
Branch: MAIN

Update to ISC cron 4.0b1 + our patches.  This is now under a BSD license.
I also fixed the signal handlers while I was at it.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.