From 17d117bb6fd2afeea8433f9251d947f960f6a95fee310bb9eb87d79d0c4c1e36 Mon Sep 17 00:00:00 2001 From: Kristyna Streitova Date: Mon, 10 May 2021 14:53:29 +0000 Subject: [PATCH 1/3] Accepting request 891605 from home:dirkmueller:Factory - update to 1.5.7: * anacron: Fix problem of anacron not being started on some desktops * crontab: switch off colors if NO_COLOR is set * crontab: crontab without arguments now works if stdin is not a TTY * crond: Fix various issues on loading the crontab databases on startup * anacron: Expand MAILTO and MAILFROM environment variables * crontab: New option to test crontab file syntax without installing it - cronie-nheader_lines.diff: refresh against 1.5.7 OBS-URL: https://build.opensuse.org/request/show/891605 OBS-URL: https://build.opensuse.org/package/show/Base:System/cronie?expand=0&rev=195 --- cronie-1.5.5.tar.gz | 3 -- cronie-1.5.7.tar.gz | 3 ++ cronie-nheader_lines.diff | 80 ++++++++++++++++----------------------- cronie.changes | 12 ++++++ cronie.spec | 2 +- 5 files changed, 49 insertions(+), 51 deletions(-) delete mode 100644 cronie-1.5.5.tar.gz create mode 100644 cronie-1.5.7.tar.gz diff --git a/cronie-1.5.5.tar.gz b/cronie-1.5.5.tar.gz deleted file mode 100644 index 1e78480..0000000 --- a/cronie-1.5.5.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:22c2a2b22577c0f776c1268d0e0f305c5c041e10155022a345b43b665da0ffe9 -size 124642 diff --git a/cronie-1.5.7.tar.gz b/cronie-1.5.7.tar.gz new file mode 100644 index 0000000..366514d --- /dev/null +++ b/cronie-1.5.7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30190b791c79bd72a43eb7cd6fced00be850e2e27e60852dec6dbacb82ecf21e +size 148739 diff --git a/cronie-nheader_lines.diff b/cronie-nheader_lines.diff index 1af1ebf..2dbd376 100644 --- a/cronie-nheader_lines.diff +++ b/cronie-nheader_lines.diff @@ -9,27 +9,23 @@ Index: src/crontab.c -#define NHEADER_LINES 0 +#define NHEADER_LINES 3 - #define COMMENT_COLOR "\x1B[34m" - #define RESET_COLOR "\033[0m" -@@ -394,7 +394,7 @@ static void parse_args(int argc, char *a + #define COMMENT_COLOR "\x1B[34m" + #define ERROR_COLOR "\x1B[31m" +@@ -418,7 +418,7 @@ static void parse_args(int argc, char *a static void list_cmd(void) { char n[MAX_FNAME]; FILE *f; - int ch; + int ch, x; - const int is_tty = isatty(STDOUT); + const int colorize = isatty(STDOUT) && getenv("NO_COLOR") == NULL; int new_line = 1; - -@@ -411,9 +411,25 @@ static void list_cmd(void) { - exit(ERROR_EXIT); - } - -- /* file is open. copy to stdout, close. -- */ - Set_LineNum(1) -+ -+ /* ignore the top few comments since we probably put them there. -+ */ + int in_comment = 0; +@@ -439,6 +439,22 @@ static void list_cmd(void) { + /* file is open. copy to stdout, close. + */ + Set_LineNum(1); ++ /* ignore the top few comments since we probably put them there. ++ */ + x = 0; + while (EOF != (ch = get_char(f))) { + if ('#' != ch) { @@ -37,18 +33,17 @@ Index: src/crontab.c + break; + } + while (EOF != (ch = get_char(f))) -+ if (ch == '\n') -+ break; ++ if (ch == '\n') ++ break; + if (++x >= NHEADER_LINES) + break; + } -+ + /* copy the rest of the crontab (if any) to the stdout. + */ while (EOF != (ch = get_char(f))) { - if (is_tty && new_line) { - if (ch == '#') { -@@ -500,7 +516,7 @@ static void edit_cmd(void) { + if (colorize) { + if (!in_comment && new_line && ch == '#') { +@@ -533,7 +549,7 @@ static void edit_cmd(void) { char n[MAX_FNAME], q[MAX_TEMPSTR]; const char *editor; FILE *f; @@ -57,20 +52,15 @@ Index: src/crontab.c struct stat statbuf; struct utimbuf utimebuf; WAIT_T waiter; -@@ -552,13 +568,25 @@ static void edit_cmd(void) { +@@ -585,10 +601,20 @@ static void edit_cmd(void) { } - Set_LineNum(1) -- /* -- * NHEADER_LINES processing removed for clarity -- * (NHEADER_LINES == 0 in all Red Hat crontabs) -- */ -- /* copy the rest of the crontab (if any) to the temp file. -- */ -- if (EOF != ch) -+ + Set_LineNum(1); +- /* +- * NHEADER_LINES processing removed for clarity +- * (NHEADER_LINES == 0 in all Red Hat crontabs) + /* ignore the top few comments since we probably put them there. -+ */ + */ + x = 0; + while (EOF != (ch = get_char(f))) { + if ('#' != ch) { @@ -79,26 +69,22 @@ Index: src/crontab.c + } + while (EOF != (ch = get_char(f))) + if (ch == '\n') -+ break; -+ if (++x >= NHEADER_LINES) -+ break; ++ break; ++ if (++x >= NHEADER_LINES) ++ break; + } -+ -+ /* copy the rest of the crontab (if any) to the temp file. -+ */ -+ if (EOF != ch) - while (EOF != (ch = get_char(f))) - putc(ch, NewCrontab); - -@@ -766,6 +794,7 @@ static int replace_cmd(void) { + /* copy the rest of the crontab (if any) to the temp file. + */ + if (EOF != ch) +@@ -812,6 +838,7 @@ static int replace_cmd(void) { + int ch, fd; int error = 0; - entry *e; uid_t file_owner; + time_t now = time(NULL); - char **envp; char *safename; - int envs = 0, entries = 0; -@@ -796,10 +825,10 @@ static int replace_cmd(void) { + + safename = host_specific_filename("#tmp", "XXXXXXXXXX"); +@@ -839,10 +866,10 @@ static int replace_cmd(void) { * * VERY IMPORTANT: make sure NHEADER_LINES agrees with this code. */ diff --git a/cronie.changes b/cronie.changes index 0977766..bb57cd4 100644 --- a/cronie.changes +++ b/cronie.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Sat May 8 20:33:29 UTC 2021 - Dirk Müller + +- update to 1.5.7: + * anacron: Fix problem of anacron not being started on some desktops + * crontab: switch off colors if NO_COLOR is set + * crontab: crontab without arguments now works if stdin is not a TTY + * crond: Fix various issues on loading the crontab databases on startup + * anacron: Expand MAILTO and MAILFROM environment variables + * crontab: New option to test crontab file syntax without installing it +- cronie-nheader_lines.diff: refresh against 1.5.7 + ------------------------------------------------------------------- Fri Mar 12 22:08:43 UTC 2021 - Dirk Müller diff --git a/cronie.spec b/cronie.spec index 6047cb4..52effb5 100644 --- a/cronie.spec +++ b/cronie.spec @@ -22,7 +22,7 @@ %define _fillupdir %{_localstatedir}/adm/fillup-templates %endif Name: cronie -Version: 1.5.5 +Version: 1.5.7 Release: 0 Summary: Cron Daemon License: BSD-3-Clause AND GPL-2.0-only AND MIT From c11bb007614a07cc683842b5549ac964e50a0068244ebbbc365b8672d97edc9e Mon Sep 17 00:00:00 2001 From: Danilo Spinella Date: Mon, 30 Aug 2021 07:31:06 +0000 Subject: [PATCH 2/3] Accepting request 914954 from home:dspinella:branches:Base:System - Change default configuration to use run-parts from debianutils instead of run-crons OBS-URL: https://build.opensuse.org/request/show/914954 OBS-URL: https://build.opensuse.org/package/show/Base:System/cronie?expand=0&rev=196 --- cronie.changes | 6 ++++++ cronie.spec | 1 + sample.root | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cronie.changes b/cronie.changes index bb57cd4..91a404e 100644 --- a/cronie.changes +++ b/cronie.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Aug 30 07:18:09 UTC 2021 - Danilo Spinella + +- Change default configuration to use run-parts from debianutils + instead of run-crons + ------------------------------------------------------------------- Sat May 8 20:33:29 UTC 2021 - Dirk Müller diff --git a/cronie.spec b/cronie.spec index 52effb5..c2d1c98 100644 --- a/cronie.spec +++ b/cronie.spec @@ -60,6 +60,7 @@ BuildRequires: pkgconfig(systemd) Requires: mail Requires(post): %fillup_prereq Requires(post): permissions +Requires(post): debianutils Requires(pre): cron Suggests: mailx Conflicts: cron <= 4.1 diff --git a/sample.root b/sample.root index 1a786eb..d69379e 100644 --- a/sample.root +++ b/sample.root @@ -12,5 +12,8 @@ MAILTO=root # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * user-name command to be executed --*/15 * * * * root test -x /usr/libexec/cron/run-crons && /usr/libexec/cron/run-crons >/dev/null 2>&1 +@hourly root run-parts /etc/cron.hourly +@daily root run-parts /etc/cron.daily +@weekly root run-parts /etc/cron.weekly +@monthly root run-parts /etc/cron.monthly From b86b100ae3c4f70c025cbae21efeabd118aa73aa9aba91b21fa03c0d19f8c7b7 Mon Sep 17 00:00:00 2001 From: Danilo Spinella Date: Mon, 30 Aug 2021 08:52:30 +0000 Subject: [PATCH 3/3] Accepting request 914973 from home:dspinella:branches:Base:System - Remove cronie-anacron-1.4.7-run-crons.patch to make anacron use run-parts OBS-URL: https://build.opensuse.org/request/show/914973 OBS-URL: https://build.opensuse.org/package/show/Base:System/cronie?expand=0&rev=197 --- cronie-anacron-1.4.7-run-crons.patch | 31 ---------------------------- cronie.changes | 2 ++ cronie.spec | 3 --- 3 files changed, 2 insertions(+), 34 deletions(-) delete mode 100644 cronie-anacron-1.4.7-run-crons.patch diff --git a/cronie-anacron-1.4.7-run-crons.patch b/cronie-anacron-1.4.7-run-crons.patch deleted file mode 100644 index 863c73b..0000000 --- a/cronie-anacron-1.4.7-run-crons.patch +++ /dev/null @@ -1,31 +0,0 @@ -Index: cronie-cronie-1.5.5/contrib/anacrontab -=================================================================== ---- cronie-cronie-1.5.5.orig/contrib/anacrontab -+++ cronie-cronie-1.5.5/contrib/anacrontab -@@ -11,6 +11,6 @@ RANDOM_DELAY=45 - 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 5 cron.daily nice /usr/libexec/cron/run-crons /etc/cron.daily -+7 25 cron.weekly nice /usr/libexec/cron/run-crons /etc/cron.weekly -+@monthly 45 cron.monthly nice /usr/libexec/cron/run-crons /etc/cron.monthly -Index: cronie-cronie-1.5.5/man/anacrontab.5 -=================================================================== ---- cronie-cronie-1.5.5.orig/man/anacrontab.5 -+++ cronie-cronie-1.5.5/man/anacrontab.5 -@@ -97,9 +97,9 @@ RANDOM_DELAY=30 - # Anacron jobs will start between 6am and 8am. - 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 0 cron.weekly nice run-parts /etc/cron.weekly --@monthly 0 cron.monthly nice run-parts /etc/cron.monthly -+1 5 cron.daily nice /usr/libexec/cron/run-crons /etc/cron.daily -+7 0 cron.weekly nice /usr/libexec/cron/run-crons /etc/cron.weekly -+@monthly 0 cron.monthly nice /usr/libexec/cron/run-crons /etc/cron.monthly - .fi - .SH "SEE ALSO" - .BR anacron (8), diff --git a/cronie.changes b/cronie.changes index 91a404e..f2c624e 100644 --- a/cronie.changes +++ b/cronie.changes @@ -3,6 +3,8 @@ Mon Aug 30 07:18:09 UTC 2021 - Danilo Spinella - Change default configuration to use run-parts from debianutils instead of run-crons +- Remove cronie-anacron-1.4.7-run-crons.patch to make anacron use + run-parts ------------------------------------------------------------------- Sat May 8 20:33:29 UTC 2021 - Dirk Müller diff --git a/cronie.spec b/cronie.spec index c2d1c98..6bd0ea3 100644 --- a/cronie.spec +++ b/cronie.spec @@ -44,8 +44,6 @@ Patch3: cronie-pam_config.diff Patch4: cronie-nheader_lines.diff # we use cron.pid instead of crond.pid Patch5: cronie-crond_pid.diff -# PATCH-FIX-UPSTREAM use run-crons instead of run-parts for anacron (bnc#689494) -Patch8: cronie-anacron-1.4.7-run-crons.patch Patch12: cronie-piddir.patch # PATCH-FIX-SUSE the first occurance of "/etc/anacrontab" was replaced by "/etc/crontab" # in manpage file because the /etc/crontab is still used in SUSE. @@ -106,7 +104,6 @@ overloaded in settings. %patch3 -p1 %patch4 %patch5 -p1 -%patch8 -p1 cp %{SOURCE7} ./cron_to_cronie.README %patch12 -p1 %patch13 -p1