Compare commits

...
This repository has been archived on 2026-01-16. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.

6 commits

Author SHA1 Message Date
Ville Skyttä
bc1ce99562 Obsoleted by cronie-anacron as of F-12. 2009-12-29 19:36:48 +00:00
Bill Nottingham
89cb7c17c9 Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-25 22:39:43 +00:00
Marcela Mašláňová
c684c1163e This package has been obsoleted by cronie. 2009-07-20 18:22:12 +00:00
Marcela Mašláňová
8a3fc308bb #507598 in case lock doesn't exist then the script spam user about non
existent file.
2009-06-30 13:14:34 +00:00
Marcela Mašláňová
8a736b2eb1 - and now upload new source 2009-05-15 12:24:10 +00:00
Marcela Mašláňová
483a8bad02 Enviroment values must be set for cronjob. 2009-05-15 11:58:51 +00:00
18 changed files with 1 additions and 3097 deletions

View file

@ -1,3 +0,0 @@
anacron_2.3.orig.tar.gz
anacron.init
0hourly

View file

@ -1,21 +0,0 @@
# Makefile for source rpm: anacron
# $Id: Makefile,v 1.1 2004/09/09 02:58:39 cvsdist Exp $
NAME := anacron
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attempt a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View file

@ -1,107 +0,0 @@
diff -up anacron-2.3/global.h.fdclose anacron-2.3/global.h
--- anacron-2.3/global.h.fdclose 2008-09-23 10:06:04.000000000 +0200
+++ anacron-2.3/global.h 2008-09-23 10:06:04.000000000 +0200
@@ -63,6 +63,7 @@ struct job_rec1 {
int tab_line;
int arg_num;
int timestamp_fd;
+ int input_fd;
int output_fd;
int mail_header_size;
pid_t job_pid;
diff -up anacron-2.3/runjob.c.fdclose anacron-2.3/runjob.c
--- anacron-2.3/runjob.c.fdclose 2008-09-23 10:06:04.000000000 +0200
+++ anacron-2.3/runjob.c 2008-09-23 10:06:04.000000000 +0200
@@ -38,12 +38,12 @@
#include <langinfo.h>
static int
-temp_file()
+temp_file(job_rec *jr)
/* Open a temporary file and return its file descriptor */
{
const int max_retries = 50;
char *name;
- int fd, i;
+ int fdin, fdout, i;
i = 0;
name = NULL;
@@ -53,16 +53,24 @@ temp_file()
free(name);
name = tempnam(NULL, NULL);
if (name == NULL) die("Can't find a unique temporary filename");
- fd = open(name, O_RDWR | O_CREAT | O_EXCL | O_APPEND,
- S_IRUSR | S_IWUSR);
+ fdout = open(name, O_WRONLY | O_CREAT | O_EXCL | O_APPEND,
+ S_IRUSR | S_IWUSR);
+ if ( fdout != -1 )
+ fdin = open(name, O_RDONLY, S_IRUSR | S_IWUSR);
/* I'm not sure we actually need to be so persistent here */
- } while (fd == -1 && errno == EEXIST && i < max_retries);
+ } while (fdout == -1 && errno == EEXIST && i < max_retries);
- if (fd == -1) die_e("Can't open temporary file");
+ if (fdout == -1) die_e("Can't open temporary file for writing");
+ if (fdin == -1) die_e("Can't open temporary file for reading");
if (unlink(name)) die_e("Can't unlink temporary file");
free(name);
- fcntl(fd, F_SETFD, 1); /* set close-on-exec flag */
- return fd;
+ fcntl(fdout, F_SETFD, 1); /* set close-on-exec flag */
+ fcntl(fdin, F_SETFD, 1); /* set close-on-exec flag */
+
+ jr->input_fd = fdin;
+ jr->output_fd = fdout;
+
+ return fdout;
}
static off_t
@@ -167,17 +175,28 @@ launch_mailer(job_rec *jr)
pid = xfork();
if (pid == 0)
{
+ long fdflags;
+
/* child */
in_background = 1;
/* set stdin to the job's output */
xclose(0);
- if (dup2(jr->output_fd, 0) != 0) die_e("Can't dup2()");
+ if (dup2(jr->input_fd, 0) != 0) die_e("Can't dup2()");
if (lseek(0, 0, SEEK_SET) != 0) die_e("Can't lseek()");
umask(old_umask);
if (sigprocmask(SIG_SETMASK, &old_sigmask, NULL))
die_e("sigprocmask error");
xcloselog();
+ /* Ensure stdout/stderr are sane before exec-ing sendmail */
+ xclose(1); xopen(1, "/dev/null", O_WRONLY);
+ xclose(2); xopen(2, "/dev/null", O_WRONLY);
+ xclose(jr->output_fd);
+
+ /* Ensure stdin is not appendable ... ? */
+ /* fdflags = fcntl(0, F_GETFL); fdflags &= ~O_APPEND; */
+ /* fcntl(0, F_SETFL, fdflags ); */
+
/* Here, I basically mirrored the way /usr/sbin/sendmail is called
* by cron on a Debian system, except for the "-oem" and "-or0s"
* options, which don't seem to be appropriate here.
@@ -236,7 +255,7 @@ launch_job(job_rec *jr)
jr->mailto = username ();
/* create temporary file for stdout and stderr of the job */
- fd = jr->output_fd = temp_file();
+ temp_file(jr); fd = jr->output_fd;
/* write mail header */
xwrite(fd, "From: ");
xwrite(fd, "Anacron <");
@@ -302,6 +321,7 @@ tend_job(job_rec *jr, int status)
running_jobs--;
if (mail_output) launch_mailer(jr);
xclose(jr->output_fd);
+ xclose(jr->input_fd);
}
void

View file

@ -1,136 +0,0 @@
diff -up anacron-2.3/global.h.fix anacron-2.3/global.h
--- anacron-2.3/global.h.fix 2009-02-19 12:27:33.000000000 +0100
+++ anacron-2.3/global.h 2009-02-19 12:27:33.000000000 +0100
@@ -100,6 +100,10 @@ extern int running_jobs,running_mailers;
extern int complaints;
+extern char *range_hours;
+
+extern int drop_job;
+
/* Function prototypes */
/* main.c */
diff -up anacron-2.3/main.c.fix anacron-2.3/main.c
--- anacron-2.3/main.c.fix 2009-02-19 12:27:33.000000000 +0100
+++ anacron-2.3/main.c 2009-02-19 12:33:04.000000000 +0100
@@ -34,6 +34,7 @@
#include <string.h>
#include "global.h"
#include "gregor.h"
+#include <fnmatch.h>
pid_t primary_pid;
int day_now;
@@ -57,6 +58,8 @@ env_rec *first_env_rec;
static time_t start_sec; /* time anacron started */
static volatile int got_sigalrm, got_sigchld, got_sigusr1;
int running_jobs, running_mailers; /* , number of */
+char *range_hours = NULL;
+int drop_job = 0;
static void
print_version()
@@ -402,22 +405,58 @@ fake_jobs()
static void
explain_intentions()
{
- int j;
+ int j, minute, hour;
+ time_t whichtime;
+ struct tm *t;
+ char *from;
+ char *to;
j = 0;
- while (j < njobs)
- {
- if (now)
- {
- explain("Will run job `%s'", job_array[j]->ident);
- }
- else
- {
- explain("Will run job `%s' in %d min.",
- job_array[j]->ident, job_array[j]->delay);
- }
- j++;
+ time(&whichtime);
+ t = localtime(&whichtime);
+ /* add delay to actual time for time ranges */
+ if (range_hours != NULL) {
+ if ((match_rx("([[:digit:]]+)-([[:digit:]]+)", range_hours, 2, &from, &to) == -1) ||
+ (from == NULL) || (to == NULL))
+ {
+ complain("START_HOURS_RANGE wasn't set correctly: %s", range_hours);
+ goto free_range;
+ }
+ }
+ while (j < njobs) {
+ minute = job_array[j]->delay + t->tm_min;
+ if (minute >= 60) {
+ hour = minute/60;
+ if (hour > 0)
+ t->tm_hour = t->tm_hour + hour; /* add how many hours has delay to actual hour */
+ explain("hour after sum %d, hour %d", t->tm_hour, hour);
+ }
+ else hour = 0;
+
+ if (!((atoi(from) < t->tm_hour) && (t->tm_hour < atoi(to))))
+ {
+ Debug(("Limit for start of job is set between %s and %s hours, which passed already.", from, to));
+ goto free_range;
+ }
+
+ if (now)
+ {
+ explain("Will run job `%s'", job_array[j]->ident);
+ }
+ else
+ {
+ explain("Will run job `%s' in %d min.",
+ job_array[j]->ident, job_array[j]->delay);
+ }
+ j++;
+ }
+
+ free_range:
+ if (range_hours != NULL) {
+ free(range_hours);
+ return;
}
+
if (serialize && njobs > 0)
explain("Jobs will be executed sequentially");
}
@@ -499,6 +538,6 @@ main(int argc, char *argv[])
launch_job(job_array[j]);
}
wait_children();
- explain("Normal exit (%d job%s run)", njobs, (njobs == 1 ? "" : "s"));
+ explain("Normal exit (%d job%s run)", njobs-drop_job, (njobs == 1 ? "" : "s"));
exit(0);
}
diff -up anacron-2.3/readtab.c.fix anacron-2.3/readtab.c
--- anacron-2.3/readtab.c.fix 2009-02-19 12:27:33.000000000 +0100
+++ anacron-2.3/readtab.c 2009-02-19 12:27:33.000000000 +0100
@@ -277,6 +277,7 @@ parse_tab_line(char *line)
{
r = match_rx("^([[:digit:]]+-[[:digit:]]+)$", value, 0);
if (r == -1) goto reg_invalid;
+ range_hours = strdup(value);
}
if (strncmp(env_var, "RANDOM_DELAY", 12) == NULL) {
r = match_rx("^([[:digit:]]+)$", value, 1);
diff -up anacron-2.3/runjob.c.fix anacron-2.3/runjob.c
--- anacron-2.3/runjob.c.fix 2009-02-19 12:27:33.000000000 +0100
+++ anacron-2.3/runjob.c 2009-02-19 12:27:33.000000000 +0100
@@ -266,6 +266,7 @@ launch_job(job_rec *jr)
if (!((atoi(from) < t->tm_hour) && (t->tm_hour < atoi(to))))
{
Debug(("Limit for start of job is set between %s and %s hours, which passed already.", from, to));
+ drop_job += 1;
free(limit);
return;
}

View file

@ -1,22 +0,0 @@
diff -up anacron-2.3/runjob.c.charset anacron-2.3/runjob.c
--- anacron-2.3/runjob.c.charset 2008-09-23 09:42:49.000000000 +0200
+++ anacron-2.3/runjob.c 2008-09-23 09:42:49.000000000 +0200
@@ -35,6 +35,8 @@
#include <string.h>
#include "global.h"
+#include <langinfo.h>
+
static int
temp_file()
/* Open a temporary file and return its file descriptor */
@@ -247,6 +249,9 @@ launch_job(job_rec *jr)
xwrite(fd, username());
}
xwrite(fd, "\n");
+ xwrite(fd, "Content-Type: text/plain; charset=\"");
+ xwrite(fd, nl_langinfo(CODESET));
+ xwrite(fd, "\"\n");
xwrite(fd, "Subject: Anacron job '");
xwrite(fd, jr->ident);
xwrite(fd, "' on ");

View file

@ -1,182 +0,0 @@
--- anacron-2.3/gregor.c.mem 2007-08-08 10:02:58.000000000 +0200
+++ anacron-2.3/gregor.c 2007-08-08 10:10:55.000000000 +0200
@@ -27,7 +27,7 @@
#include <time.h>
#include "gregor.h"
-const static int
+static const int
days_in_month[] = {
31, /* Jan */
28, /* Feb (non-leap) */
--- anacron-2.3/log.c.mem 2007-08-08 10:02:58.000000000 +0200
+++ anacron-2.3/log.c 2007-08-08 10:13:03.000000000 +0200
@@ -83,7 +83,7 @@
}
static void
-log(int priority, const char *fmt, va_list args)
+slog(int priority, const char *fmt, va_list args)
/* Log a message, described by "fmt" and "args", with the specified
* "priority". */
{
@@ -101,7 +101,7 @@
static void
log_e(int priority, const char *fmt, va_list args)
-/* Same as log(), but also appends an error description corresponding
+/* Same as slog(), but also appends an error description corresponding
* to "errno". */
{
int saved_errno;
@@ -127,7 +127,7 @@
va_list args;
va_start(args, fmt);
- log(EXPLAIN_LEVEL, fmt, args);
+ slog(EXPLAIN_LEVEL, fmt, args);
va_end(args);
}
@@ -149,7 +149,7 @@
va_list args;
va_start(args, fmt);
- log(COMPLAIN_LEVEL, fmt, args);
+ slog(COMPLAIN_LEVEL, fmt, args);
va_end(args);
complaints += 1;
@@ -175,7 +175,7 @@
va_list args;
va_start(args, fmt);
- log(COMPLAIN_LEVEL, fmt, args);
+ slog(COMPLAIN_LEVEL, fmt, args);
va_end(args);
if (getpid() == primary_pid) complain("Aborted");
@@ -207,7 +207,7 @@
va_list args;
va_start(args, fmt);
- log(DEBUG_LEVEL, fmt, args);
+ slog(DEBUG_LEVEL, fmt, args);
va_end(args);
}
--- anacron-2.3/global.h.mem 2007-08-08 10:02:58.000000000 +0200
+++ anacron-2.3/global.h 2007-08-08 10:10:21.000000000 +0200
@@ -105,18 +105,25 @@
/* main.c */
int xopen(int fd, const char *file_name, int flags);
void xclose(int fd);
-pid_t xfork();
+pid_t xfork(void);
+
+#ifdef __GNUC__
+#define PRINTF_FORMAT(n, m) \
+ __attribute__ ((format (printf, n, m)))
+#else
+#define PRINTF_FORMAT(n, m)
+#endif
/* log.c */
-void explain(const char *fmt, ...);
-void explain_e(const char *fmt, ...);
-void complain(const char *fmt, ...);
-void complain_e(const char *fmt, ...);
-void die(const char *fmt, ...);
-void die_e(const char *fmt, ...);
-void xdebug(const char *fmt, ...);
-void xdebug_e(const char *fmt, ...);
-void xcloselog();
+void explain(const char *fmt, ...)PRINTF_FORMAT(1,2);
+void explain_e(const char *fmt, ...)PRINTF_FORMAT(1,2);
+void complain(const char *fmt, ...)PRINTF_FORMAT(1,2);
+void complain_e(const char *fmt, ...)PRINTF_FORMAT(1,2);
+void die(const char *fmt, ...)PRINTF_FORMAT(1,2);
+void die_e(const char *fmt, ...)PRINTF_FORMAT(1,2);
+void xdebug(const char *fmt, ...)PRINTF_FORMAT(1,2);
+void xdebug_e(const char *fmt, ...)PRINTF_FORMAT(1,2);
+void xcloselog(void);
#ifdef DEBUG
#define Debug(args) xdebug args
@@ -128,7 +135,7 @@
/* readtab.c */
void read_tab(int cwd);
-void arrange_jobs();
+void arrange_jobs(void);
/* lock.c */
int consider_job(job_rec *jr);
--- anacron-2.3/runjob.c.mem 2007-08-08 10:02:58.000000000 +0200
+++ anacron-2.3/runjob.c 2007-08-08 10:17:44.000000000 +0200
@@ -64,8 +64,8 @@
if (fdin == -1) die_e("Can't open temporary file for reading");
if (unlink(name)) die_e("Can't unlink temporary file");
free(name);
- fcntl(fdout, F_SETFD, 1); /* set close-on-exec flag */
- fcntl(fdin, F_SETFD, 1); /* set close-on-exec flag */
+ fcntl(fdout, F_SETFD, FD_CLOEXEC); /* set close-on-exec flag */
+ fcntl(fdin, F_SETFD, FD_CLOEXEC); /* set close-on-exec flag */
jr->input_fd = fdin;
jr->output_fd = fdout;
@@ -175,8 +175,6 @@
pid = xfork();
if (pid == 0)
{
- long fdflags;
-
/* child */
in_background = 1;
/* set stdin to the job's output */
--- anacron-2.3/matchrx.c.mem 2000-06-21 01:12:18.000000000 +0200
+++ anacron-2.3/matchrx.c 2007-08-08 10:16:54.000000000 +0200
@@ -26,6 +26,7 @@
#include <regex.h>
#include <stdarg.h>
#include <stdlib.h>
+#include <string.h>
#include "matchrx.h"
int
@@ -49,11 +50,20 @@
sub_offsets = malloc(sizeof(regmatch_t) * (n_sub + 1));
memset(sub_offsets, 0, sizeof(regmatch_t) * (n_sub + 1));
- if (regcomp(&crx, rx, REG_EXTENDED)) return - 1;
+ if (regcomp(&crx, rx, REG_EXTENDED)) {
+ free(sub_offsets);
+ return - 1;
+ }
r = regexec(&crx, string, n_sub + 1, sub_offsets, 0);
- if (r != 0 && r != REG_NOMATCH) return - 1;
+ if (r != 0 && r != REG_NOMATCH) {
+ free(sub_offsets);
+ return - 1;
+ }
regfree(&crx);
- if (r == REG_NOMATCH) return 0;
+ if (r == REG_NOMATCH) {
+ free(sub_offsets);
+ return 0;
+ }
va_start(va, n_sub);
n = 1;
@@ -62,7 +72,10 @@
substring = va_arg(va, char**);
if (substring != NULL)
{
- if (sub_offsets[n].rm_so == -1) return - 1;
+ if (sub_offsets[n].rm_so == -1) {
+ free(sub_offsets);
+ return - 1;
+ }
*substring = string + sub_offsets[n].rm_so;
*(string + sub_offsets[n].rm_eo) = 0;
}

View file

@ -1,12 +0,0 @@
--- anacron-2.3/Makefile.piee 2006-10-17 12:39:39.000000000 +0200
+++ anacron-2.3/Makefile 2006-10-17 12:39:39.000000000 +0200
@@ -22,7 +22,8 @@
PREFIX =
BINDIR = $(PREFIX)/usr/sbin
MANDIR = $(PREFIX)/usr/man
-CFLAGS = -Wall -pedantic -O2
+LDFLAGS = -fpie -Wl,-z,relro
+CFLAGS = -Wall -pedantic -W -Wundef -fpie
#CFLAGS = -Wall -O2 -g -DDEBUG
# If you change these, please update the man-pages too

View file

@ -1,82 +0,0 @@
diff -up anacron-2.3/main.c.random anacron-2.3/main.c
--- anacron-2.3/main.c.random 2009-02-16 10:27:46.000000000 +0100
+++ anacron-2.3/main.c 2009-02-16 10:27:46.000000000 +0100
@@ -24,6 +24,7 @@
#include <time.h>
+#include <sys/time.h>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
@@ -430,6 +431,13 @@ main(int argc, char *argv[])
anacrontab = NULL;
spooldir = NULL;
+ struct timeval tv;
+ struct timezone tz;
+
+ if (gettimeofday(&tv, &tz) != 0)
+ explain("Can't get exact time, failure.");
+
+ srandom(getpid()+tv.tv_usec);
if((program_name = strrchr(argv[0], '/')) == NULL)
program_name = argv[0];
diff -up anacron-2.3/readtab.c.random anacron-2.3/readtab.c
--- anacron-2.3/readtab.c.random 2009-02-16 10:27:46.000000000 +0100
+++ anacron-2.3/readtab.c 2009-02-16 10:30:05.000000000 +0100
@@ -48,6 +48,8 @@ static int line_num; /* curr
static job_rec *last_job_rec; /* last job stored in memory, at the moment */
static env_rec *last_env_rec; /* last environment assignment stored */
+static int RANDOM;
+
/* some definitions for the obstack macros */
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
@@ -144,6 +146,15 @@ register_env(const char *env_var, const
Debug(("on line %d: %s", line_num, er->assign));
}
+static int
+random_delay(int delay) {
+ int i = random();
+ double x = 0;
+
+ x = (double) i / (double) RAND_MAX * (double) delay;
+ return (int)x;
+}
+
static void
register_job(const char *periods, const char *delays,
const char *ident, char *command)
@@ -167,6 +178,8 @@ register_job(const char *periods, const
jr = obstack_alloc(&tab_o, sizeof(job_rec));
jr->period = period;
jr->named_period = 0;
+ if (RANDOM > 0)
+ delay += random_delay(RANDOM);
jr->delay = delay;
jr->tab_line = line_num;
jr->ident = obstack_alloc(&tab_o, ident_len + 1);
@@ -215,6 +228,8 @@ register_period_job(const char *periods,
anacrontab, line_num);
}
jr->period = 0;
+ if (RANDOM > 0)
+ delay += random_delay(RANDOM);
jr->delay = delay;
jr->tab_line = line_num;
jr->ident = obstack_alloc(&tab_o, ident_len + 1);
@@ -263,6 +278,10 @@ parse_tab_line(char *line)
r = match_rx("^([[:digit:]]+-[[:digit:]]+)$", value, 0);
if (r == -1) goto reg_invalid;
}
+ if (strncmp(env_var, "RANDOM_DELAY", 12) == NULL) {
+ r = match_rx("^([[:digit:]]+)$", value, 1);
+ RANDOM = atoi(value);
+ }
register_env(env_var, value);
return;
}

View file

@ -1,199 +0,0 @@
diff -up anacron-2.3.new/main.c.range-rnd anacron-2.3.new/main.c
--- anacron-2.3.new/main.c.range-rnd 2009-03-24 10:12:23.000000000 +0100
+++ anacron-2.3.new/main.c 2009-03-24 12:01:24.000000000 +0100
@@ -24,6 +24,7 @@
#include <time.h>
+#include <sys/time.h>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
@@ -31,6 +32,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
+#include <stdlib.h>
#include "global.h"
#include "gregor.h"
@@ -56,6 +58,8 @@ env_rec *first_env_rec;
static time_t start_sec; /* time anacron started */
static volatile int got_sigalrm, got_sigchld, got_sigusr1;
int running_jobs, running_mailers; /* , number of */
+int range_start = -1;
+int range_stop = -1;
static void
print_version()
@@ -402,6 +406,7 @@ static void
explain_intentions()
{
int j;
+ struct tm *t;
j = 0;
while (j < njobs)
@@ -412,8 +417,21 @@ explain_intentions()
}
else
{
- explain("Will run job `%s' in %d min.",
+ time_t jobtime = start_sec + job_array[j]->delay * 60;
+
+ t = localtime(&jobtime);
+ if (range_start != -1 && range_stop != -1 &&
+ (t->tm_hour < range_start || t->tm_hour >= range_stop))
+ {
+ Debug(("The job `%s' falls out of the %02d:00-%02d:00 hours range, skipping.",
+ job_array[j]->ident, range_start, range_stop));
+ job_array[j]->drop_job = 1;
+ }
+ else
+ {
+ explain("Will run job `%s' in %d min.",
job_array[j]->ident, job_array[j]->delay);
+ }
}
j++;
}
@@ -428,8 +446,17 @@ main(int argc, char *argv[])
int cwd;
+ int dropped_jobs = 0;
+
anacrontab = NULL;
spooldir = NULL;
+ struct timeval tv;
+ struct timezone tz;
+
+ if (gettimeofday(&tv, &tz) != 0)
+ explain("Can't get exact time, failure.");
+
+ srandom(getpid()+tv.tv_usec);
if((program_name = strrchr(argv[0], '/')) == NULL)
program_name = argv[0];
@@ -486,11 +513,16 @@ main(int argc, char *argv[])
running_jobs = running_mailers = 0;
for(j = 0; j < njobs; ++j)
{
+ if (job_array[j]->drop_job == 1)
+ {
+ ++dropped_jobs;
+ continue;
+ }
xsleep(time_till(job_array[j]));
if (serialize) wait_jobs();
launch_job(job_array[j]);
}
wait_children();
- explain("Normal exit (%d job%s run)", njobs, (njobs == 1 ? "" : "s"));
+ explain("Normal exit (%d job%s run)", njobs-dropped_jobs, (njobs-dropped_jobs == 1 ? "" : "s"));
exit(0);
}
diff -up anacron-2.3.new/global.h.range-rnd anacron-2.3.new/global.h
--- anacron-2.3.new/global.h.range-rnd 2009-03-24 10:12:23.000000000 +0100
+++ anacron-2.3.new/global.h 2009-03-24 12:01:10.000000000 +0100
@@ -68,6 +68,7 @@ struct job_rec1 {
int mail_header_size;
pid_t job_pid;
pid_t mailer_pid;
+ int drop_job;
struct job_rec1 *next;
env_rec *prev_env_rec;
@@ -100,6 +101,10 @@ extern int running_jobs,running_mailers;
extern int complaints;
+/* time ranges for START_HOURS_RANGE */
+extern int range_start;
+extern int range_stop;
+
/* Function prototypes */
/* main.c */
diff -up anacron-2.3.new/log.c.range-rnd anacron-2.3.new/log.c
--- anacron-2.3.new/log.c.range-rnd 2009-03-24 10:12:23.000000000 +0100
+++ anacron-2.3.new/log.c 2009-03-24 12:01:56.000000000 +0100
@@ -43,6 +43,7 @@
#include <signal.h>
#include <sys/types.h>
#include <string.h>
+#include <stdlib.h>
#include "global.h"
static char truncated[] = " (truncated)";
diff -up anacron-2.3.new/readtab.c.range-rnd anacron-2.3.new/readtab.c
--- anacron-2.3.new/readtab.c.range-rnd 2009-03-24 10:12:23.000000000 +0100
+++ anacron-2.3.new/readtab.c 2009-03-24 11:51:08.000000000 +0100
@@ -48,6 +48,8 @@ static int line_num; /* curr
static job_rec *last_job_rec; /* last job stored in memory, at the moment */
static env_rec *last_env_rec; /* last environment assignment stored */
+static int random_number = 0;
+
/* some definitions for the obstack macros */
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
@@ -167,6 +169,7 @@ register_job(const char *periods, const
jr = obstack_alloc(&tab_o, sizeof(job_rec));
jr->period = period;
jr->named_period = 0;
+ delay += random_number;
jr->delay = delay;
jr->tab_line = line_num;
jr->ident = obstack_alloc(&tab_o, ident_len + 1);
@@ -215,6 +218,7 @@ register_period_job(const char *periods,
anacrontab, line_num);
}
jr->period = 0;
+ delay += random_number;
jr->delay = delay;
jr->tab_line = line_num;
jr->ident = obstack_alloc(&tab_o, ident_len + 1);
@@ -242,6 +246,8 @@ parse_tab_line(char *line)
char *delays;
char *ident;
char *command;
+ char *from;
+ char *to;
/* an empty line? */
r = match_rx("^[ \t]*($|#)", line, 0);
@@ -258,6 +264,25 @@ parse_tab_line(char *line)
if (r == -1) goto reg_err;
if (r)
{
+ if (strncmp(env_var, "START_HOURS_RANGE", 17) == 0)
+ {
+ r = match_rx("^([[:digit:]]+)-([[:digit:]]+)$", value, 2, &from, &to);
+ if ((r == -1) || (from == NULL) || (to == NULL)) goto reg_invalid;
+ range_start = atoi(from);
+ range_stop = atoi(to);
+ Debug(("Jobs will start in the %02d:00-%02d:00 range.", range_start, range_stop));
+ }
+ if (strncmp(env_var, "RANDOM_DELAY", 12) == 0) {
+ r = match_rx("^([[:digit:]]+)$", value, 1);
+ if (r != -1) {
+ int i = random();
+ double x = 0;
+ x = (double) i / (double) RAND_MAX * (double) (atoi(value));
+ random_number = (int)x;
+ Debug(("Randomized delay set: %d", random_number));
+ }
+ else goto reg_invalid;
+ }
register_env(env_var, value);
return;
}
@@ -284,6 +309,7 @@ parse_tab_line(char *line)
return;
}
+ reg_invalid:
complain("Invalid syntax in %s on line %d - skipping this line",
anacrontab, line_num);
return;

View file

@ -1,80 +0,0 @@
diff -up anacron-2.3/readtab.c.range anacron-2.3/readtab.c
--- anacron-2.3/readtab.c.range 2009-02-16 10:20:08.000000000 +0100
+++ anacron-2.3/readtab.c 2009-02-16 10:25:15.000000000 +0100
@@ -258,6 +258,11 @@ parse_tab_line(char *line)
if (r == -1) goto reg_err;
if (r)
{
+ if (strcmp(env_var, "START_HOURS_RANGE") == 0)
+ {
+ r = match_rx("^([[:digit:]]+-[[:digit:]]+)$", value, 0);
+ if (r == -1) goto reg_invalid;
+ }
register_env(env_var, value);
return;
}
@@ -284,6 +289,7 @@ parse_tab_line(char *line)
return;
}
+ reg_invalid:
complain("Invalid syntax in %s on line %d - skipping this line",
anacrontab, line_num);
return;
diff -up anacron-2.3/runjob.c.range anacron-2.3/runjob.c
--- anacron-2.3/runjob.c.range 2009-02-16 10:20:08.000000000 +0100
+++ anacron-2.3/runjob.c 2009-02-16 10:20:08.000000000 +0100
@@ -34,8 +34,9 @@
#include <stdio.h>
#include <string.h>
#include "global.h"
-
+#include <time.h>
#include <langinfo.h>
+#include <fnmatch.h>
static int
temp_file(job_rec *jr)
@@ -236,14 +237,40 @@ launch_job(job_rec *jr)
int fd;
char hostname[512];
char *mailto;
-
+ char *limit;
+ char *from;
+ char *to;
+ time_t now;
+ struct tm *t;
/* get hostname */
if (gethostname(hostname, 512)) {
strcpy (hostname,"unknown machine");
}
setup_env(jr);
-
+
+ limit = getenv("START_HOURS_RANGE");
+ if (limit != NULL)
+ limit = strdup(limit);
+ if (limit != NULL)
+ {
+ time(&now);
+ t = localtime(&now);
+ if ((match_rx("^([[:digit:]]+)-([[:digit:]]+)$", limit, 2, &from, &to) == -1) ||
+ (from == NULL) || (to == NULL))
+ {
+ complain("START_HOURS_RANGE wasn't set correctly: %s", limit);
+ free(limit);
+ return;
+ }
+ if (!((atoi(from) < t->tm_hour) && (t->tm_hour < atoi(to))))
+ {
+ Debug(("Limit for start of job is set between %s and %s hours, which passed already.", from, to));
+ free(limit);
+ return;
+ }
+ free(limit);
+ }
/* Get the destination email address if set, or current user otherwise */
mailto = getenv("MAILTO");

View file

@ -1,12 +0,0 @@
diff -up anacron-2.3/readtab.c.spool anacron-2.3/readtab.c
--- anacron-2.3/readtab.c.spool 2008-04-09 11:04:21.000000000 +0200
+++ anacron-2.3/readtab.c 2008-04-09 11:23:09.000000000 +0200
@@ -305,7 +305,7 @@ read_tab(int cwd)
/* Open the anacrontab file */
fchdir (cwd);
tab = fopen(anacrontab, "r");
- if (chdir(spooldir)) die_e("Can't chdir to %s", SPOOLDIR);
+ if (chdir(spooldir)) die_e("Can't chdir to %s", spooldir);
if (tab == NULL) die_e("Error opening %s", anacrontab);
/* Initialize the obstacks */

View file

@ -1,92 +0,0 @@
#!/bin/sh
# Startup script for anacron
#
# chkconfig: - 95 05
# description: Run cron jobs that were left out due to downtime
# pidfile: /var/run/anacron.pid
#
# Source function library.
. /etc/rc.d/init.d/functions
[ -f /usr/sbin/anacron ] || exit 0
prog="anacron"
PIDFILE=/var/run/${prog}.pid
LOCKFILE=/var/lock/subsys/$prog
#
# NOTE: anacron exits after it has determined it has no more work to do.
# Hence, its initscript cannot do normal lock file management.
# The anacron binary now creates its own /var/run/anacron.pid pid file
# and /var/lock/subsys lock files, and removes them automatically at exit,
# so at least there will be no more "anacron is dead but subsys locked"
# messages.
#
start() {
echo -n $"Starting $prog: "
# on_ac_power doesn't exist, on_ac_power returns 0 (ac power being used)
if [ -x /usr/bin/on_ac_power ]; then
/usr/bin/on_ac_power > /dev/null 2>&1
if [ $? -eq 1 ]; then
echo "deferred while on battery power."
RETVAL=0
exit 0
fi
fi
daemon +19 anacron -s
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
failure;
fi;
echo
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
if [ -f $PIDFILE ]; then
killproc anacron
RETVAL=$?
if [ $RETVAL -ne 0 ]; then
failure;
fi;
else
RETVAL=1
failure;
fi
echo
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status anacron
;;
restart)
stop
start
;;
condrestart)
if [ -f $LOCKFILE ]; then
stop
start
fi
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVAL

View file

@ -1,404 +0,0 @@
Summary: A cron-like program that can run jobs lost during downtime
Name: anacron
Version: 2.3
Release: 74%{?dist}
License: GPLv2+
Group: System Environment/Base
URL: http://packages.debian.org/stable/source/anacron
Source: http://ftp.debian.org/debian/pool/main/a/anacron/%{name}_%{version}.orig.tar.gz
Source1: anacrontab
Source2: 0hourly
Source3: anacron
Patch1: anacron_2.3-13.patch
Patch2: anacron-2.3-mail-content-type-77108.patch
Patch3: anacron-2.3-fdclose.patch
Patch4: anacron-2.3-pic.patch
Patch5: anacron-2.3-memleaking.patch
Patch6: anacron-2.3-spooldir.patch
#Patch7: anacron-2.3-range.patch
#Patch8: anacron-2.3-random.patch
Patch9: manAUX_Limit.patch
Patch10: anacron-2.3-range-rnd.patch
Requires: crontabs
Requires: initscripts
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
Requires(postun): /sbin/service
Requires(preun): /sbin/service
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
%description
Anacron (like `anac(h)ronistic') is a periodic command scheduler.
It executes commands at intervals specified in days. Unlike cron, it
does not assume that the system is running continuously. It can
therefore be used to control the execution of daily, weekly and
monthly jobs (or anything with a period of n days), on systems that
don't run 24 hours a day. When installed and configured properly,
Anacron will make sure that the commands are run at the specified
intervals as closely as machine-uptime permits.
This package is pre-configured to execute the daily jobs of the Red
Hat Linux (or Fedora) system. It's part of triple - cronie, anacron
and crontabs, which care about execution of jobs also with often
reboots or hibernation.
%prep
%setup -q
%patch1 -p1 -b .try
%patch2 -p1 -b .charset
%patch3 -p1 -b .fdclose
%patch4 -p1 -b .pic
%patch5 -p1 -b .memleaking
%patch6 -p1 -b .spool
#%patch7 -p1 -b .range
#%patch8 -p1 -b .random
%patch9 -p1
%patch10 -p1 -b .fix
%build
make CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/{etc/,usr/sbin/,%{_mandir}/man5,%{_mandir}/man8/}
mkdir -p $RPM_BUILD_ROOT/var/spool/anacron/
cp anacron $RPM_BUILD_ROOT/usr/sbin
cp anacron.8 $RPM_BUILD_ROOT/%{_mandir}/man8/
cp anacrontab.5 $RPM_BUILD_ROOT/%{_mandir}/man5/
cp %SOURCE1 $RPM_BUILD_ROOT/etc
for i in cron.daily cron.weekly cron.monthly cron.hourly;do
mkdir -p $RPM_BUILD_ROOT/etc/$i/
done
mkdir -p $RPM_BUILD_ROOT/etc/cron.d/
install -c -m755 %SOURCE2 $RPM_BUILD_ROOT/etc/cron.d/0hourly
install -c -m755 %SOURCE3 $RPM_BUILD_ROOT/etc/cron.hourly/0anacron
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,0755)
%doc COPYING README
%config(noreplace) /etc/anacrontab
%dir /var/spool/anacron/
%{_mandir}/man5/*
%{_mandir}/man8/*
/usr/sbin/anacron
%attr(644,root,root) /etc/cron.d/0hourly
%attr(755,root,root) /etc/cron.hourly/0anacron
%changelog
* Tue Apr 14 2009 Marcela Mašláňová <mmaslano@redhat.com> 2.3-74
- 495333 fix ungrammatical job(s) in log
* Fri Mar 27 2009 Marcela Mašláňová <mmaslano@redhat.com> 2.3-73
- rewrite the range and random patches with checking log to one
more lucid with help of tmraz.
* Fri Mar 6 2009 Marcela Mašláňová <mmaslano@redhat.com> 2.3-72
- 488916 fix typo in bash script again.
* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3-71
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Thu Feb 19 2009 Marcela Mašláňová <mmaslano@redhat.com> 2.3-70
- incorrect logging of jobs - fixed number of executed jobs
- really planed jobs are mentioned
- 252254 fix typo in bash script 0anacron
* Tue Feb 10 2009 Marcela Mašláňová <mmaslano@redhat.com> 2.3-69
- apply fix of my previous range patch from tmraz
- fix man page
* Fri Feb 6 2009 Marcela Mašláňová <mmaslano@redhat.com> 2.3-68
- add two new options:
- 481775 some people don't want to run daily jobs at all, if they
didn't run in specific time f.e. 4-7 hours.
- 470168 random delay was removed from crontabs and added into
anacron, where could be better set.
- cron.d/0hourly will every hour run cron.hourly/0anacron which
check whether the jobs should be running or not
* Thu Jan 28 2009 Marcela Mašláňová <mmaslano@redhat.com> 2.3-67
- 482782 output in init script redirected
* Mon Jan 26 2009 Marcela Mašláňová <mmaslano@redhat.com> 2.3-66
- cron.{daily,weekly,hourly,monthly} should be owned by crontabs, because
some don't have installed anacron and other cron like programmes could
be dependent
- 0anacron is now trying run all cron.{daily,weekly,...} every hour.
This should fix problem with jobs running twice, with not running jobs
after hibernation and so on.
- the random delay is in default switch off
* Fri Oct 24 2008 Marcela Mašláňová <mmaslano@redhat.com> 2.3-65
- rewrite init script - using fedora guidelines SysVInitScript
* Wed Jul 30 2008 Marcela Maslanova <mmaslano@redhat.com> 2.3-64
- fix fuzz
- fix previous patch, thanks to mbroz
* Wed Jul 30 2008 Marcela Maslanova <mmaslano@redhat.com> 2.3-62
- 441576 really stop anacron daemon
* Wed May 28 2008 Marcela Maslanova <mmaslano@redhat.com> 2.3-61
- cleaning lots of scripts in anacron & crontabs
* Wed Apr 9 2008 Marcela Maslanova <mmaslano@redhat.com> 2.3-60
- correct spooldir logged
* Thu Feb 28 2008 Marcela Maslanova <mmaslano@redhat.com> 2.3-59
- 0anacron.{daily,weekly,monthly} sterror's output also goes to dev/null
- rhbz#435255
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.3-58
- Autorebuild for GCC 4.3
* Mon Dec 10 2007 Marcela Maslanova <mmaslano@redhat.com> 2.3-57
- 0anacron.{daily,weekly,monthly} check whether they are on battery
- rhbz#387301
* Tue Sep 25 2007 Marcela Maslanova <mmaslano@redhat.com> 2.3-56
- cron.{hourly,daily} work correct -> remove checking whether
cron.daily has been run
- persist: run pc between midnight and 4:02 -> cron.daily run twice.
- rhbz#296741
* Fri Aug 31 2007 Marcela Maslanova <mmaslano@redhat.com> 2.3-55
- change chkconfig --add, because it wasn't running after
fresh install #267801
* Thu Aug 30 2007 Marcela Maslanova <mmaslano@redhat.com> 2.3-54
- change chkconfig levels in post part
* Wed Aug 17 2007 Marcela Maslanova <mmaslano@redhat.com> 2.3-53
- rebuild with changed post - starting value must be removed
- Resolves: 252166, 252255, 252254
* Tue Aug 14 2007 Marcela Maslanova <mmaslano@redhat.com> 2.3-51
- rebuild with correct init script
* Mon Aug 13 2007 Marcela Maslanova <mmaslano@redhat.com> 2.3-50
- rewrite typo in init script
- Resolves: rhbz#251757
* Wed Aug 08 2007 Marcela Maslanova <mmaslano@redhat.com> 2.3-49
- adopt some patches from upstream for better locking
- add own changes, which resolve problem with two or more run of
cron.daily per day.
- Resolves: #157448
* Wed Jul 11 2007 Marcela Maslanova <mmaslano@redhat.com> 2.3-48
- changes in init script (not build)
* Tue Feb 6 2007 Marcela Maslanova <mmaslano@redhat.com> 2.3-47
- thanks for review from Jef Spaleta
- rhbz#225247, rhbz#211309
* Mon Dec 04 2006 Marcela Maslanova <mmaslano@redhat.com> 2.3-45
- rebuilt with pie insted pic
* Tue Oct 10 2006 Marcela Maslanova <mmaslano@redhat.com> 2.3-44
- fix memory leaking (both #210020)
- PIE(PIC) executable
* Tue Oct 2 2006 Marcela Maslanova <mmaslano@redhat.com> 2.3-42
- hostname added to mail (#208914)
* Fri Sep 29 2006 Marcela Maslanova <mmaslano@redhat.com> 2.3-41
- change spec file - patch from Orion Poplawski (#191410)
* Mon Sep 11 2006 Dan Walsh <dwalsh@redhat.com> 2.3-40
- Grab the fdclose patch from FC4
- fix bug 185973: allow use of sendmail under selinux-policy-strict:
apply patch contributed by Ted Rule<ejtr@layer3.co.uk>
* Wed Aug 30 2006 Jitka Kudrnacova <jkudrnac@redhat.com> - 2.3-39
- modified PATH in /etc/anacrontab file to make the same as in /etc/crontab (#61891)
* Wed Jul 12 2006 Jesse Keating <jkeating@redhat.com> - 2.3-38.FC6.1
- rebuild
* Thu Apr 13 2006 Jason Vas Dias <jvdias@redhat.com> - 2.3-38.1
- fix bug 188403: anacron SysVinit locking:
Since anacron just exits when it has no more work to do, the
initscript cannot do normal /var/lock/subsys/anacron lock file
creation, else messages such as 'anacron dead but subsys locked'
will appear when changing init levels.
Now, the anacron process itself creates its own
/var/lock/subsys/anacron SysVinit lock file and
/var/run/anacron.pid pid file to co-operate more
gracefully with the initscript system.
* Fri Feb 10 2006 Jesse Keating <jkeating@redhat.com> - 2.3-36.1
- bump again for double-long bug on ppc(64)
* Tue Feb 07 2006 Jason Vas Dias <jvdias@redhat.com> - 2.3-36
- rebuild for new gcc, glibc, glibc-kernheaders
* Wed Jan 11 2006 Peter Jones <pjones@redhat.com> 2.3-35
- Fix initscript so changing runlevel shuts it down correctly
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
- rebuilt
* Wed Mar 16 2005 Jason Vas Dias <jvdias@redhat.com> 2.3-34
- Rebuild with gcc4 in FC4.
* Mon Feb 21 2005 Jason Vas Dias <jvdias@redhat.com> 2.3-33
- Rebuild for FC4 .
* Tue Sep 28 2004 Rik van Riel <riel@redhat.com> 2.3-32
- add MAILTO option, like vixie cron has (bz#127924)
* Fri Jul 2 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt
- Add noconst patch to fix invalid C
* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Thu Jul 10 2003 Jens Petersen <petersen@redhat.com> - 2.3-29
- don't require vixie-cron (#21176) [reported by Gerald Teschl]
- in init script don't remove /var/lock/subsys/anacron when stopping (#58462)
- exit init script with actual exit status (#44600) [reported by Enrico Scholz]
* Thu Jul 10 2003 Jens Petersen <petersen@redhat.com> - 2.3-28
- add a Content-Type header to mails giving the charset encoding (#77108)
* Thu Jul 10 2003 Jens Petersen <petersen@redhat.com> - 2.3-27
- in init script do not touch /var/lock/subsys/anacron when starting (#58462)
- require crontabs (#21176)
- update source url
* Wed Jun 04 2003 Elliot Lee <sopwith@redhat.com>
- rebuilt
* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt
* Wed Dec 11 2002 Tim Powers <timp@redhat.com> 2.3-24
- rebuild on all arches
* Fri Aug 23 2002 Jens Petersen <petersen@redhat.com> 2.3-23
- delay the start of anacron by 60min to make startup more pleasant (#68304)
- at startup run jobs serially and nice 19 to reduce load (#65870, #68304)
- spec file now in utf-8
- dont install non-existant NEWS file
- silence make include warnings
* Fri Jul 19 2002 Akira TAGOH <tagoh@redhat.com> 2.3-22
- fix the stripped binary issue.
* Mon Jul 08 2002 Bill Huang <bhuang@redhat.com>
- Update "Copyright" to "License" in spec file
* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Thu May 23 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Wed Jan 09 2002 Tim Powers <timp@redhat.com>
- automated rebuild
* Sun Jun 24 2001 Elliot Lee <sopwith@redhat.com>
- Bump release + rebuild.
* Tue Apr 3 2001 Crutcher Dunnavant <crutcher@redhat.com>
- add dependancy to vixie-cron (for /usr/bin/run-parts)
* Tue Feb 13 2001 Tim Waugh <twaugh@redhat.com>
- killproc is a shell function and can't be passed as a parameter
(bug #27150).
* Mon Feb 5 2001 Bernhard Rosenkraenzer <bero@redhat.com>
- Fix i18n in initscript ("Stopping anacron" wasn't translated)
(#26076)
* Fri Feb 2 2001 Trond Eivind Glomsrød <teg@redhat.com>
- i18nize initscript
* Thu Dec 7 2000 Crutcher Dunnavant <crutcher@redhat.com>
- rebuild in rebuild cycle.
* Mon Oct 30 2000 Matt Wilson <msw@redhat.com>
- touch /var/lock/subsys/anacron to prevent excess startage during
init level change
* Wed Aug 30 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Shut down earlier to prevent NFS mounted /usr filesystems from causing
problems (Bug #16257)
* Fri Aug 4 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Start it later so services some cron scripts may depend on are running
(Bug #15335)
* Thu Aug 3 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Fix up initscript (Bug #15123 and an unreported bug)
* Sat Jul 15 2000 Bill Nottingham <notting@redhat.com>
- move initscript back
* Wed Jul 12 2000 Prospector <bugzilla@redhat.com>
- automatic rebuild
* Mon Jul 10 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- Fix up initscripts (Bug #13625)
* Tue Jul 4 2000 Matt Wilson <msw@redhat.com>
- Prereq: /sbin/chkconfig
* Mon Jun 26 2000 Preston Brown <pbrown@redhat.com>
- move initscript to /etc/init.d, fix up post/preun/postun scripts.
* Sun Jun 26 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- 2.3
* Sun Jun 18 2000 Matt Wilson <msw@redhat.com>
- use %%{_mandir}
* Fri Mar 03 2000 Tim Powers <timp@redhat.com>
- fixed startup script so that it doesn't put stuff in /var/lock/subsys.
Complains since anacronda turns itself off when it is run, and the file in
/var/lock/subsys isn't removed.
* Mon Feb 28 2000 Tim Powers <timp@redhat.com>
- fixed startup script, now it actually stops, gives status and restarts.
Fixes bug #9835
* Mon Feb 7 2000 Bill Nottingham <notting@redhat.com>
- handle compressed manpages
* Fri Feb 4 2000 Bernhard Rosenkraenzer <bero@redhat.com>
- rebuild to get compressed man pages
- mark /etc/cron.daily/... as config files
* Wed Feb 02 2000 Cristian Gafton <gafton@redhat.com>
- fix annoying defines
- rebuild to update description and group
* Thu Jan 6 2000 Bernhard Rosenkränzer <bero@redhat.com>
- initial Red Hat package
* Wed Dec 29 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- Remove cron.hourly check (unusefull).
* Wed Nov 10 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- 2.1 from debian.
- Fix typo in initscripts.
* Thu Jul 22 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- Fix wrong entries in anacrontab.
- Add a /etc/rc.sysinit/ script
* Tue Apr 27 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- Fix bug with /var/spool/anacron/
* Sat Apr 10 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- First version mainly inspired from the Debian package.

File diff suppressed because it is too large Load diff

View file

@ -1,16 +0,0 @@
# /etc/anacrontab: configuration file for anacron
# See anacron(8) and anacrontab(5) for details.
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# the maximal random delay added to the base delay of the jobs
RANDOM_DELAY=45
# the jobs will be started during the following hours only
START_HOURS_RANGE=3-22
#period in days delay in minutes job-identifier command
1 5 cron.daily nice run-parts /etc/cron.daily
7 25 cron.weekly nice run-parts /etc/cron.weekly
@monthly 45 cron.monthly nice run-parts /etc/cron.monthly

1
dead.package Normal file
View file

@ -0,0 +1 @@
Obsoleted by cronie-anacron as of F-12.

View file

@ -1,96 +0,0 @@
diff -up anacron-2.3/anacron.8.aux anacron-2.3/anacron.8
--- anacron-2.3/anacron.8.aux 2009-03-24 14:16:39.000000000 +0100
+++ anacron-2.3/anacron.8 2009-03-24 14:22:41.000000000 +0100
@@ -1,4 +1,4 @@
-.TH ANACRON 8 2004-07-11 "Pascal Hakim" "Anacron Users' Manual"
+.TH ANACRON 8 2009-03-24 "Marcela Mašláňová" "Anacron Users' Manual"
.SH NAME
anacron \- runs commands periodically
.SH SYNOPSIS
@@ -66,8 +66,8 @@ exists. If the LOGNAME environment varia
field.
.PP
Informative messages about what Anacron is doing are sent to \fBsyslogd(8)\fR
-under facility \fBcron\fR, priority \fBnotice\fR. Error messages are sent at
-priority \fBerror\fR.
+or \fBrsyslogd(8)\fR under facility \fBcron\fR, priority \fBnotice\fR. Error
+messages are sent at priority \fBerror\fR.
.PP
"Active" jobs (i.e. jobs that Anacron already decided
to run and now wait for their delay to pass, and jobs that are currently
@@ -163,4 +163,5 @@ The current implementation is a complete
The code base was maintained by Sean 'Shaleh' Perry <shaleh@(debian.org|valinux.com)>.
.PP
Since 2004, it is maintained by Pascal Hakim <pasc@(debian.org|redellipse.net)>.
-
+.PP
+For Fedora is anacron maintained by Marcela Mašláňová <mmaslano@redhat.com>.
diff -up anacron-2.3/anacrontab.5.aux anacron-2.3/anacrontab.5
--- anacron-2.3/anacrontab.5.aux 2009-03-24 14:16:39.000000000 +0100
+++ anacron-2.3/anacrontab.5 2009-03-24 14:23:39.000000000 +0100
@@ -1,4 +1,4 @@
-.TH ANACRONTAB 5 2004-07-11 "Pascal Hakim" "Anacron Users' Manual"
+.TH ANACRONTAB 5 2009-03-24 "Marcela Mašláňová" "Anacron Users' Manual"
.SH NAME
/etc/anacrontab \- configuration file for anacron
.SH DESCRIPTION
@@ -15,11 +15,20 @@ Job-description lines are of one of thes
.PP
@period_name delay job-identify command
.PP
-The
+The
.I period
-is specified in days, the
+is specified in days, the
.I delay
-in minutes. The
+in minutes. In addition, if the
+.I RANDOM_DELAY
+environment variable is set, then the value of
+.I RANDOM_DELAY
+is added to the delay. The value in
+.I RANDOM_DELAY
+denotes a maximal additional delay in minutes, where the minimum delay value is set, to user delay from anacrontab. A
+.I RANDOM_DELAY
+set to 12 would therefore add, randomly, between 0 and 12 minutes to the user defined delay.
+The
.I job-identifier
can contain any non-blank character, except slashes. It is used to identify
the job in Anacron messages,
@@ -42,12 +51,28 @@ are removed. No spaces around
.I VALUE
are allowed (unless you want them to be part of the value). The assignment
takes effect from the next line to the end of the file, or to the next
-assignment of the same variable.
+assignment of the same variable. The enviroment variable
+.I START_HOURS_RANGE
+sets the time frame, when the job could started.
.PP
Empty lines are either blank lines, line containing white-space only, or
lines with white-space followed by a '#' followed by an arbitrary comment.
.PP
You can continue a line onto the next line by ending it with a '\'.
+.SH EXAMPLE
+.nf
+# environment variables
+SHELL=/bin/sh
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+MAILTO=root
+RANDOM_DELAY=60
+# Anacron jobs will start between 6 and 8 o'clock.
+START_HOURS_RANGE=6-8
+# delay will be 5 minutes + RANDOM_DELAY for cron.daily
+1 5 cron.daily nice run-parts /etc/cron.daily
+7 8 cron.weekly nice run-parts /etc/cron.weekly
+@monthly 35 cron.monthly nice run-parts /etc/cron.monthly
+.fi
.SH "SEE ALSO"
.B anacron(8)
.PP
@@ -58,3 +83,5 @@ file.
Itai Tzur <itzur@actcom.co.il>
.PP
Currently maintained by Pascal Hakim <pasc@(debian.org|redellipse.net)>.
+.PP
+For Fedora maintained by Marcela Mašláňová <mmaslano@redhat.com>.

View file

@ -1,3 +0,0 @@
9fdfc50f5741643332722a9145146278 anacron_2.3.orig.tar.gz
e354dcd88554723abd476f069c90069d 0hourly
110558bab1719a8b91598fdcfceebed0 anacron