commit 691c7df2d4504fa8a06c70046f3cc5c3dc30c0d2 Author: Adrian Schröter Date: Mon Oct 14 14:05:45 2024 +0200 Sync from SUSE:ALP:Source:Standard:1.0 cronie revision a670bc3e35e097aa7c2adbf999fdb95d diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fecc750 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/cron.service b/cron.service new file mode 100644 index 0000000..6debc66 --- /dev/null +++ b/cron.service @@ -0,0 +1,14 @@ +[Unit] +Description=Command Scheduler +After=nss-user-lookup.target network.target time-sync.target +After=postfix.service sendmail.service exim.service + +[Service] +ExecStart=/usr/sbin/cron -n +ExecReload=/usr/bin/kill -s SIGHUP $MAINPID +Restart=on-abort +KillMode=process +TasksMax=infinity + +[Install] +WantedBy=multi-user.target diff --git a/cron_to_cronie.README b/cron_to_cronie.README new file mode 100644 index 0000000..3d97ecc --- /dev/null +++ b/cron_to_cronie.README @@ -0,0 +1,5 @@ +package cron 4.2 is only auxiliary package needed for proper renaming package cron to cronie + +usefull links : +http://en.opensuse.org/Cron_replace +http://en.opensuse.org/Cron_rename diff --git a/cronie-1.6.1.tar.gz b/cronie-1.6.1.tar.gz new file mode 100644 index 0000000..b5394a6 --- /dev/null +++ b/cronie-1.6.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ddbc8f8d07dfe1d45998b0a0cbd9a216cd4d7bc64d1626b2bc8b3a69e4641d1 +size 149913 diff --git a/cronie-crond_pid.diff b/cronie-crond_pid.diff new file mode 100644 index 0000000..f087fc6 --- /dev/null +++ b/cronie-crond_pid.diff @@ -0,0 +1,13 @@ +Index: cronie-1.4.4/src/pathnames.h +=================================================================== +--- cronie-1.4.4.orig/src/pathnames.h ++++ cronie-1.4.4/src/pathnames.h +@@ -41,7 +41,7 @@ + # define PIDDIR SYSCONFDIR "/" + # endif + #endif +-#define PIDFILE "crond.pid" ++#define PIDFILE "cron.pid" + #define _PATH_CRON_PID PIDDIR PIDFILE + #define REBOOT_LOCK PIDDIR "cron.reboot" + diff --git a/cronie-nheader_lines.diff b/cronie-nheader_lines.diff new file mode 100644 index 0000000..8d5ab05 --- /dev/null +++ b/cronie-nheader_lines.diff @@ -0,0 +1,101 @@ +Index: src/crontab.c +=================================================================== +--- src/crontab.c.orig ++++ src/crontab.c +@@ -64,7 +64,7 @@ + #include "pathnames.h" + #include "structs.h" + +-#define NHEADER_LINES 0 ++#define NHEADER_LINES 3 + + #define COMMENT_COLOR "\x1B[34;1m" + #define ERROR_COLOR "\x1B[31;1m" +@@ -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 colorize = isatty(STDOUT) && getenv("NO_COLOR") == NULL; + int new_line = 1; + 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) { ++ putchar(ch); ++ break; ++ } ++ while (EOF != (ch = get_char(f))) ++ 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 (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; +- int ch = '\0', t; ++ int ch = '\0', t, x; + struct stat statbuf; + struct utimbuf utimebuf; + WAIT_T waiter; +@@ -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) ++ /* ignore the top few comments since we probably put them there. + */ ++ x = 0; ++ while (EOF != (ch = get_char(f))) { ++ if ('#' != ch) { ++ putc(ch, NewCrontab); ++ break; ++ } ++ while (EOF != (ch = get_char(f))) ++ if (ch == '\n') ++ break; ++ if (++x >= NHEADER_LINES) ++ break; ++ } + /* 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; + uid_t file_owner; ++ time_t now = time(NULL); + char *safename; + + 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. + */ +- /*fprintf(tmp, "# DO NOT EDIT THIS FILE - edit the master and reinstall.\n"); +- *fprintf(tmp, "# (%s installed on %-24.24s)\n", Filename, ctime(&now)); +- *fprintf(tmp, "# (Cron version %s)\n", CRON_VERSION); +- */ ++ fprintf(tmp, "# DO NOT EDIT THIS FILE - edit the master and reinstall.\n"); ++ fprintf(tmp, "# (%s installed on %-24.24s)\n", Filename, ctime(&now)); ++ fprintf(tmp, "# (Cronie version %s)\n", CRON_VERSION); ++ + #ifdef WITH_SELINUX + if (selinux_context) + fprintf(tmp, "SELINUX_ROLE_TYPE=%s\n", selinux_context); diff --git a/cronie-pam_config.diff b/cronie-pam_config.diff new file mode 100644 index 0000000..09e40c7 --- /dev/null +++ b/cronie-pam_config.diff @@ -0,0 +1,20 @@ +Index: cronie-cronie-1.5.4/pam/crond +=================================================================== +--- cronie-cronie-1.5.4.orig/pam/crond ++++ cronie-cronie-1.5.4/pam/crond +@@ -4,8 +4,10 @@ + # + # Although no PAM authentication is called, auth modules + # are used for credential setting +-auth include system-auth +-account required pam_access.so +-account include system-auth +-session required pam_loginuid.so +-session include system-auth ++auth sufficient pam_rootok.so ++account sufficient pam_listfile.so item=user sense=allow file=/etc/cron.allow onerr=succeed quiet ++auth include common-auth ++account include common-account ++password include common-password ++session optional pam_keyinit.so force revoke ++session include common-session diff --git a/cronie.changes b/cronie.changes new file mode 100644 index 0000000..339c90e --- /dev/null +++ b/cronie.changes @@ -0,0 +1,1478 @@ +------------------------------------------------------------------- +Tue Dec 20 16:10:11 UTC 2022 - Stefan Schubert + +- Use %_pam_vendordir + +------------------------------------------------------------------- +Wed Dec 7 10:11:32 UTC 2022 - Stefan Schubert + +- Migration PAM settings to /usr/etc: Saving user changed + configuration files in /etc and restoring them while an RPM + update. +- Removed update support from 4.1 vixie-cron which is really old. + +------------------------------------------------------------------- +Wed May 11 09:17:27 UTC 2022 - Danilo Spinella + +- Update to 1.6.1: + * Fix a regression in handling ranges (x-y) in crontab +- Remove upstreamed patch: + * bsc1198265.patch + +------------------------------------------------------------------- +Thu Apr 14 13:19:35 UTC 2022 - Danilo Spinella + +- Fix bsc#1198265 Regression in handling 1-5 crontab entries + * bsc1198265.patch + +------------------------------------------------------------------- +Tue Mar 29 13:08:02 UTC 2022 - Danilo Spinella + +- Update to 1.6.0: + * Add switch -f for foreground mode + * Fix regression in handling */x crontab entries + * Add random within range '~' operator + * Fix RandomScale calculation + * crond: Fix description of '-P' option + * Increase the maximum number of crontab entries + * crontab: use bold colors +- Remove upstreamed patches: + * cronie-1.5.7-increase_crontab_limit.patch + * cronie-piddir.patch +- Refresh patches: + * cronie-nheader_lines.diff + * cronie-cron_pid.diff + +------------------------------------------------------------------- +Wed Sep 15 12:00:14 UTC 2021 - Danilo Spinella + +- Increase limit of allowed entries in crontab files to fix bsc#1187508 + * cronie-1.5.7-increase_crontab_limit.patch +- Run spec-cleaner +- Remove cronie-rpmlintrc as the filter was unused + +------------------------------------------------------------------- +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 + +- 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 + +- refresh spec files (move license to licensedir) + +------------------------------------------------------------------- +Mon Aug 31 14:25:09 UTC 2020 - Kristyna Streitova + +- Use the new value of %_libexecdir macro (/usr/lib -> /usr/libexec) + in crontab and other occurences: [bsc#1175934] + * cronie-anacron-1.4.7-run-crons.patch + * run-crons + * sample.root + * sysconfig.cron + +------------------------------------------------------------------- +Tue Jun 23 10:38:53 UTC 2020 - Ismail Dönmez + +- Add an example job definition to sample.root + +------------------------------------------------------------------- +Tue Dec 3 17:05:04 UTC 2019 - Malte Kraus + +- change permissions calls in spec file to use slashes for + directories [boo#1158130] + +------------------------------------------------------------------- +Wed Nov 20 15:18:24 UTC 2019 - Kristyna Streitova + +- drop 'checkproc' line from the run-crons as the usage is bogus + [bsc#1155929] + +------------------------------------------------------------------- +Tue Nov 5 16:07:57 UTC 2019 - Kristyna Streitova + +- update cronie-nheader_lines.diff so it doesn't print the first 3 + crontab lines (static comments) with the 'crontab -l' command + [bsc#1155114] + +------------------------------------------------------------------- +Fri Nov 1 17:10:22 UTC 2019 - Kristyna Streitova + +- update to 1.5.5 + * Avoid warning for strncat. + * crontab: fsync to check for full disk + * crontab: Add Y/N to retry prompt + * entries: Explicitly validate upper ranges and steps + * crond: report missing newline before EOF + * do not log carriage return + * skip directories when given as crontabs + * crontab -l colors comment lines in a different color + * getdtablesize() can return very high values in containers + * Power supply name not detected correctly. + * Revert "Avoid creating pid files when crond doesn't fork" + * anacron: fix types in comparisons + * mics: stop using plain integer as NULL pointer + * cron: fix type in comparison and variable shadowing + * cron: mark signal number arguments in signal handlers unused + * Move allowed() and related function to security.c + * cronnext: optionally select jobs by substring + * crond: Do not abort loading crontab prematurely in case of error +- refresh cronie-nheader_lines.diff +- remove cronie-1.5.4-dont_abort_loading_crontab.patch and + cronie-1.5.4-always_create_pid_file.patch (applied upstream) + +------------------------------------------------------------------- +Tue Aug 27 12:24:27 UTC 2019 - Kristyna Streitova + +- refresh cronie-pam_config.diff to integrate pam_keyinit pam + module [bsc#1144044] + +------------------------------------------------------------------- +Mon Aug 19 19:01:01 UTC 2019 - Thorsten Kukuk + +- Add /etc/cron.* directories to cron sub-package from filesystem + - allows correct usage of permissions macros + - fixes installation of this directories on systems without cron + +------------------------------------------------------------------- +Thu May 16 10:16:10 UTC 2019 - Kristýna Streitová + +- add cronie-1.5.4-always_create_pid_file.patch to always create + a pid file even when the cron daemon does not fork. The PID file + is useful to avoid running multiple "cron -n" instances at once + [bsc#1133100] + +------------------------------------------------------------------- +Fri Mar 29 13:50:01 UTC 2019 - Kristýna Streitová + +- update to 1.5.4 + * crond: Fix regression from previous release. Only first job + from a crontab was being run [bsc#1130746] +- add cronie-1.5.4-dont_abort_loading_crontab.patch to not abort + loading crontab prematurely in case of error + +------------------------------------------------------------------- +Sun Mar 17 10:37:44 UTC 2019 - Kristýna Streitová + +- update to 1.5.3 + * Fix CVE-2019-9704 [bnc#1128937] and CVE-2019-9705 [bnc#1128935] + to avoid local DoS of the crond + * crontab: Make crontab without arguments fail + * crond: In PAM configuration include system-auth instead of + password-auth + * crond: In the systemd service file restart crond if it fails + * crond: Use the role from the crond context for system job + contexts + * Multiple small cleanups and fixes. +- refresh cronie-nheader_lines.diff and cronie-pam_config.diff + +------------------------------------------------------------------- +Wed Feb 6 15:47:40 UTC 2019 - Cristian Rodríguez + +- cron.service: No limit on the number of processes spawned by cron + shall be imposed. + +------------------------------------------------------------------- +Tue Oct 30 13:14:10 UTC 2018 - Cristian Rodríguez + +- cronie-pam_config.diff: When crond is started with the -n + switch like it does with systemd, the manual explicitly + instructs to disable the pam_loginuid module. + +------------------------------------------------------------------- +Mon Sep 17 14:04:46 UTC 2018 - kstreitova@suse.com + +- update to 1.5.2 + * cronnext: New useful utility to find out time of the next job + run. + * crond: Avoid creating PID files when crond doesn't fork. + * crontab: Do not try to replace the crontab with a directory. + * crond: Log startup even when started in non-forking mode. + * Multiple small cleanups and fixes. +- update Source address +- remove cronie-1.4.7-disable_logging.patch and restore the + original cronie behaviour (a line starting with a dash in + normal user's crontab is handled as incorrect), there was enough + time for crontab migration. Manpage part of the patch was applied + upstream +- remove cronie-nofork-nopid.patch (applied upstream) +- pack cronnext utility +- call autoreconf + +------------------------------------------------------------------- +Thu Nov 30 12:43:52 UTC 2017 - rbrown@suse.com + +- Requires mail as it's really needed by cron-crons script, not + smtp_daemon [bsc#1070565] [bsc#1064834] + +------------------------------------------------------------------- +Mon Nov 27 09:48:27 UTC 2017 - jsegitz@suse.com + +- Ensure that /etc/cron.{hourly,daily,weekly,monthly} have proper + permissions and owner. This is racy but prevents some LPE vectors + +------------------------------------------------------------------- +Fri Nov 24 17:25:56 UTC 2017 - kstreitova@suse.com + +- Requires smtp_daemon (not just Recommends) as it's needed by + run-crons script [bsc#1064834] + +------------------------------------------------------------------- +Thu Nov 23 13:39:47 UTC 2017 - rbrown@suse.com + +- Replace references to /var/adm/fillup-templates with new + %_fillupdir macro (boo#1069468) + +------------------------------------------------------------------- +Mon Aug 21 09:31:32 CEST 2017 - kukuk@suse.de + +- Require group trusted if we use them + +------------------------------------------------------------------- +Tue Mar 28 09:18:55 UTC 2017 - kstreitova@suse.com + +- update to 1.5.1 + * crontab: Use temporary file name that is ignored by crond. + * crond: Inherit PATH from the crond environment if -P option + is used. + * crond: Remove hardcoded "system_u" SELinux user, use the + SELinux user + of the running crond. + * anacron: Small cleanups and fixes. + * crond: Fix longstanding race condition on repeated crontab + modification. +- refresh cronie-pam_config.diff +- get rid of %{name} macros in the patch names +- use %{ext_man} macro for anacron man pages +- fedorahosted.org was retired on March 1st, 2017 + * update Url and Source address + +------------------------------------------------------------------- +Thu Mar 23 15:14:29 UTC 2017 - kstreitova@suse.com + +- cleanup with spec-cleaner + +------------------------------------------------------------------- +Fri Sep 30 14:35:34 UTC 2016 - kstreitova@suse.com + +- remove the omc xml config that is useless nowdays + +------------------------------------------------------------------- +Thu Sep 8 10:24:43 UTC 2016 - tchvatal@suse.com + +- Add fix for bnc#983925 to run crons even when not on AC_POWER + * Nowdays it does not make much sense to not run crons when on + battery and actually it can even confuse people + +------------------------------------------------------------------- +Wed Jul 1 20:11:18 UTC 2015 - crrodriguez@opensuse.org + +- cron.service: Use KillMode=process like upstream does. + +------------------------------------------------------------------- +Thu Jun 25 19:13:40 UTC 2015 - crrodriguez@opensuse.org + +- revert last change, it is a bug in sssd.service, fixed in + SR#313709 + +------------------------------------------------------------------- +Thu Jun 25 13:39:16 UTC 2015 - jmatejek@suse.com + +- add support for MAILFROM, MAIL_CONFIG and different mailer binaries + in run-crons (bnc#812367, bnc#366762) + +------------------------------------------------------------------- +Tue Jun 23 08:27:40 UTC 2015 - tchvatal@suse.com + +- Start cron after sssd.service bnc#926961 + +------------------------------------------------------------------- +Mon Jun 22 14:21:25 UTC 2015 - tchvatal@suse.com + +- Redo the post/pre update approach to fix migration from SLE11. + Should fix bnc#919028 + +------------------------------------------------------------------- +Fri Jun 19 14:51:05 UTC 2015 - kstreitova@suse.com + +- update to 1.5.0 + * crond: Job environment variables are set also when executing + sendmail. + * crond: Adding duplicate orphans on reload is now prevented. + * crond: The regular crond shutdown is now logged. + * crontab: PAM is not called in crontab command if the caller's + uid is 0. + * crond: PAM is not called from crond for system cron jobs + (/etc/crontab, /etc/cron.d) which are run for uid 0. + * crond: The existence of an user is checked at time when job is + run and not when the crontab is parsed on database reload. +- use spec-cleaner + +------------------------------------------------------------------- +Thu Jun 4 00:51:52 UTC 2015 - crrodriguez@opensuse.org + +- cron.service: Start After=nss-user-lookup.target not + after ypbind.service nscd.service +-cron.service: Crons run at wall-time, order after time-sync.target + +------------------------------------------------------------------- +Sun Nov 09 03:14:00 UTC 2014 - Led + +- fix bashisms in pre scripts + +------------------------------------------------------------------- +Mon Sep 22 09:39:02 UTC 2014 - kstreitova@suse.com + + - fixes bnc#833240: the first occurance of "/etc/anacrontab" +replaced with "/etc/crontab" in the manpage file + - version updated to 1.4.12 + * various small bugfixes + +------------------------------------------------------------------- +Thu Sep 11 13:59:08 UTC 2014 - kstreitova@suse.com + +- clean up with spec-cleaner + +------------------------------------------------------------------- +Thu Sep 11 13:51:44 UTC 2014 - kstreitova@suse.com + +- fix dangling symlink on sbin/service + +------------------------------------------------------------------- +Fri Aug 1 14:32:37 UTC 2014 - vcizek@suse.com + +- add sysconfig.cron that used to be provided by aaa_base (bnc#860058) + +------------------------------------------------------------------- +Mon Jun 16 13:51:14 UTC 2014 - vdziewiecki@suse.com + +-Add an option to manually reload cron. + +------------------------------------------------------------------- +Thu Jan 30 13:57:03 UTC 2014 - vdziewiecki@suse.com + +-Restart the service if it crashes + +------------------------------------------------------------------- +Thu Jan 23 21:08:55 UTC 2014 - aj@ajaissle.de + +- Leave /usr/sbin/rccron in as link to /sbin/service + +------------------------------------------------------------------- +Sun Oct 20 14:50:52 UTC 2013 - p.drouand@gmail.com + +- Remove old sysvinit hacks; none target distributions use sysvinit + +------------------------------------------------------------------- +Wed Sep 25 16:02:13 UTC 2013 - vdziewiecki@suse.com + +- Update to 1.4.11 +- I removed these patches: cronie-1.4.8-bug_756197.diff +bug-786096_cronie-fdleak.diff, since those issuas appear to have +been addressed upstream. +------------------------------------------------------------------- +Tue Sep 10 21:30:58 UTC 2013 - crrodriguez@opensuse.org + +- define PIDIDIR to "/run" instead of the (outdated) definition + coming from glibc "paths.h" +- systemd: there is no mail-transfer-agent target anymore, services + must be ordered After= a list of possible MTA. + +------------------------------------------------------------------- +Sun Apr 14 02:14:21 UTC 2013 - crrodriguez@opensuse.org + +- Ordering units after syslog.target is no longer recommended. + +------------------------------------------------------------------- +Fri Mar 22 08:35:17 UTC 2013 - mmeister@suse.com + +- Added url as source. + Please see http://en.opensuse.org/SourceUrls + +------------------------------------------------------------------- +Thu Feb 7 12:19:58 UTC 2013 - meissner@suse.com + +- fixed the file descriptor leak correctly (bnc#786096,bnc#802345) + +------------------------------------------------------------------- +Mon Feb 4 14:20:48 UTC 2013 - fcrozat@suse.com + +- Regenerate cronie-pam_config.diff, last line of the patch was not + properly added, causing bnc#801553. + +------------------------------------------------------------------- +Mon Nov 12 13:44:06 UTC 2012 - vdziewiecki@suse.com + +-Fix Bug 786096 - VUL-1: cron: does not close file descriptors before invocation of commands + +------------------------------------------------------------------- +Sun Oct 28 18:31:20 UTC 2012 - crrodriguez@opensuse.org + +- DO not require sysvinit(syslog), the journal is enough + +------------------------------------------------------------------- +Thu Oct 18 10:26:33 UTC 2012 - coolo@suse.com + +- buildrequire systemd by pkgconfig provide to get systemd-mini + in build environments (to break cycle) + +------------------------------------------------------------------- +Wed Aug 15 00:48:54 UTC 2012 - crrodriguez@opensuse.org + +- When the cron daemon does not fork, as it is the case + when using systemd, pid files are useless. avoid creating + them in the first place. + +------------------------------------------------------------------- +Mon Jun 25 10:38:29 UTC 2012 - coolo@suse.com + +- the recommends for postfix was from a time when smtp_daemon + was required, now that smtp_daemon is recommended, the recommend + for postfix is between useless and harmful - so reduce it to a suggests + +------------------------------------------------------------------- +Wed May 30 14:49:41 UTC 2012 - sweet_f_a@gmx.de + +- remove useless autmake dependency + +------------------------------------------------------------------- +Tue Apr 10 14:28:34 UTC 2012 - tabraham@novell.com + +- added cronie-1.4.8-bug_756197.diff to remove references to anacron + in crontab.5 + +------------------------------------------------------------------- +Wed Jan 18 15:15:14 UTC 2012 - tabraham@novell.com + +- removed cronie-1.4.7-syslog_output.patch deprecated by this update + +- Update to 1.4.8 + + Cron writes job output to syslog incorrectly. When cron is + invoked in a way to print job output to syslog, it does print + only the first character of the output + + Check orphanded crontabs for adoption + + Unify logging in case SyslogOutput with the rest of crond + + The charset of anacron's mail is always ANSI_X3.4-1968. There + are no setlocale in anacron's source + + Cronie disables inotify when the /etc/crontab file does not + exist at startup. Existance of crontab and directories wasn't + controlled before creating inotify watches. + +------------------------------------------------------------------- +Wed Nov 30 14:54:08 UTC 2011 - aj@suse.de + +- Add dependency on ypbind and nscd (bnc#732356) +- Do not install generic INSTALL file. +- Use set_permissions for newer distros. + +------------------------------------------------------------------- +Wed Nov 30 09:47:40 UTC 2011 - coolo@suse.com + +- add automake as buildrequire to avoid implicit dependency + +------------------------------------------------------------------- +Tue Nov 29 17:07:07 UTC 2011 - crrodriguez@opensuse.org + +- Cron started before network is up [bnc#733275] + +------------------------------------------------------------------- +Fri Oct 7 12:11:17 UTC 2011 - fcrozat@suse.com + +- Ensure service_add_post is called in %post and not verify. + +------------------------------------------------------------------- +Thu Sep 29 09:17:49 UTC 2011 - fcrozat@suse.com + +- Use systemd macros to register cron.service. + +------------------------------------------------------------------- +Sun Sep 18 00:00:19 UTC 2011 - jengelh@medozas.de + +- Remove redundant tags/sections from specfile + +------------------------------------------------------------------- +Mon Jul 11 10:28:40 UTC 2011 - vcizek@novell.com + +- changed run-parts to run-crons in anacron (bnc#689494) + +------------------------------------------------------------------- +Mon Jun 6 08:51:11 UTC 2011 - vcizek@novell.com + +- mention possibility of disabling logging to syslog in the crontab + manual +- to keep compatibility with 11.3, execute the command despite + an unprivileged user tries to disable logging (bnc#698549) + +------------------------------------------------------------------- +Wed May 11 08:27:14 UTC 2011 - vcizek@novell.com + +- corrected job output via syslog (bnc#692871) + +------------------------------------------------------------------- +Wed Apr 27 16:56:21 UTC 2011 - vcizek@novell.com + +- update to 1.4.7 + many bugs fixed (including bnc#690166) + +------------------------------------------------------------------- +Thu Feb 24 12:33:31 UTC 2011 - vcizek@novell.com + +- bnc#662433 again: + added quiet option to pam config, in order to avoid logging, + when /etc/cron.allow is missing + +------------------------------------------------------------------- +Thu Jan 6 15:25:44 UTC 2011 - vcizek@novell.com + +- fix for bnc#662433 : + Accounts with disabled user login, but listed in /etc/cron.allow + were unable to run cron jobs + +------------------------------------------------------------------- +Fri Dec 10 12:46:12 UTC 2010 - aj@suse.de + +- cron.service needs to be after mta. + +------------------------------------------------------------------- +Tue Dec 7 21:16:31 UTC 2010 - coolo@novell.com + +- prereq init script syslog + +------------------------------------------------------------------- +Tue Nov 9 15:38:33 UTC 2010 - cristian.rodriguez@opensuse.org + +- use full RELRO here. + +------------------------------------------------------------------- +Mon Nov 8 13:15:59 UTC 2010 - aj@suse.de + +- Fix rpm group of cronie-anacron + +------------------------------------------------------------------- +Mon Nov 8 12:52:17 UTC 2010 - aj@suse.de + +- Fix package list. + +------------------------------------------------------------------- +Sun Oct 31 12:37:02 UTC 2010 - jengelh@medozas.de + +- Use %_smp_mflags + +------------------------------------------------------------------- +Wed Oct 27 09:04:54 UTC 2010 - aj@suse.de + +- Add cron.service for systemd. + +------------------------------------------------------------------- +Wed Oct 27 08:31:19 UTC 2010 - mseben@gmail.com + +- Update to cronie 1.4.6 + * man/anacron.8, man/anacrontab.5, man/cron.8, man/crontab.1, + man/crontab.5: Rewrite of man pages & correction + * man/bitstring.3: Remove useless man page + * Check clustering before un/watch function + * Remove cluster support from inotify_database + * The crontab command uses "-c" and "-n" instead of "-h" + +------------------------------------------------------------------- +Mon Oct 25 11:08:38 UTC 2010 - coolo@novell.com + +- use cronie_version not cron's version for anacron + +------------------------------------------------------------------- +Thu Oct 21 19:32:39 UTC 2010 - cristian.rodriguez@opensuse.org + +- Update to cronie 1.4.5_git201010210619 + * Fix broken ifdef HAS_FCHOWN + * Cronie supports "clustering" now. + +------------------------------------------------------------------- +Wed Oct 13 17:42:15 UTC 2010 - mseben@gmail.com + +- added scriptlets and subpackage cron for propper update + +------------------------------------------------------------------- +Thu Aug 26 01:34:34 UTC 2010 - cristian.rodriguez@opensuse.org + +- Update to cronie 1.4.5 +- drop upstreamed patches in particular minuslog and pam_conv. +- cronie can work without sendmail now, if absent syslog is used. + +------------------------------------------------------------------- +Wed Apr 7 18:50:23 UTC 2010 - mseben@novell.com + +- added crond_pid.diff to finaly fix cron.pid issue which breaks + init script + +------------------------------------------------------------------- +Thu Mar 25 14:28:30 UTC 2010 - mseben@novell.com + +- updated to version 1.4.4 + * src/crontab.c: CVE-2010-0424 -- crontab -e crontab file timestamp + race condition + * configure.ac: Dynamic shared libraries -laudit There is need to + add -laudit into gcc options because now it's no found automatically. + * man/anacrontab.5: Make man page more readable based on #564206. + * crond.sysconfig, cronie.init: CRON_VALIDATE_MAILRCPTS was removed, + because it was not used anyway. + * src/do_command.c, src/funcs.h, src/security.c: With NFS homes + can't be job executed, because root can't access this directory. + * man/cron.8, src/do_command.c: Disable mailing output. + * man/cron.8, src/cron.c, src/do_command.c, src/globals.h: Output + could be redirectered to syslog. + * src/security.c: Cron doesn't use environment values from + /etc/security/pam_env.conf. This was fixed by moving pam_setcred + into first part of authentication of pam. + * cronie.init: Initscript: if unprivileged user stop deamon, it + should return 4. + * cronie.init: Initscript: if unprivileged user restart deamon, it + should return 4. + * src/security.c: This function will be probably removed from + libselinux, so it is added into source code here. + * pam/crond: One line was missing in pam authentication. rhbz#533189 + * Makefile.am, configure.ac: Autotools - Makefile includes + dailyjobs, configure has new version. + +------------------------------------------------------------------- +Fri Feb 19 13:58:34 UTC 2010 - mseben@novell.com + +- added race-mtime_new.patch : to fix crontab -e crontab file + timestamp race condition (bnc#580800) (CVE-2010-0424) + +------------------------------------------------------------------- +Wed Feb 3 22:03:53 UTC 2010 - mseben@novell.com + +- added nheader_lines.diff : ignore top three lines of comments in + crontab file when user use crontab -e +- added $RPM_OPT_FLAGS to build stage + +------------------------------------------------------------------- +Sat Dec 19 18:13:04 CET 2009 - jengelh@medozas.de + +- enable parallel build + +------------------------------------------------------------------- +Thu Dec 17 07:28:54 UTC 2009 - mseben@novell.com + +- added subpackage cronie-anacron + +------------------------------------------------------------------- +Wed Dec 9 12:24:49 UTC 2009 - mseben@novell.com + +- added pam_conv.diff to add pam conversationfrom function +- added pam_config.diff to add pam config file from old cron +- added Provides: cron = 4.2, Obsoletes: cron <= 4.1 +- added SPOOL_DIR="/var/spool/cron/tabs" to build section to correct + tabs dir for users + +------------------------------------------------------------------- +Tue Dec 8 17:03:14 UTC 2009 - mseben@novell.com + +- added minuslog.diff and remove_old_system.diff + from cron package + +------------------------------------------------------------------- +Mon Dec 7 22:49:49 UTC 2009 - crrodriguez@opensuse.org + +- enable anacron build +- enable audit support +- cleanup spec file a bit + +------------------------------------------------------------------- +Sat Dec 5 21:36:57 UTC 2009 - mseben@novell.com + +- switch to cronie 1.4.3, see project page : + https://fedorahosted.org/cronie/ +- anacron and audit support disabled for now +- /usr/sbin/cron renamed to /usr/sbin/crond + +------------------------------------------------------------------- +Fri Nov 27 10:08:49 UTC 2009 - mseben@novell.com + +- added initgroups_check.patch : verify return value of + initgroups (bnc#537178) (CVE-2006-2607) + +------------------------------------------------------------------- +Wed Nov 18 17:18:44 UTC 2009 - mseben@novell.com + +- added pam conversion function (reworked pam.diff) fate#306386 + +------------------------------------------------------------------- +Wed Nov 18 14:39:49 UTC 2009 - mseben@novell.com + +- modified run-crons script : added support for new SEND_OUTPUT_ON_NO_ERROR + sysconfig option to block status mails from cron jobs with empty + output (fate#305279) + +------------------------------------------------------------------- +Tue Nov 3 19:09:11 UTC 2009 - coolo@novell.com + +- updated patches to apply with fuzz=0 + +------------------------------------------------------------------- +Wed Oct 14 18:28:22 CEST 2009 - ro@suse.de + +- init script: remove "-p $PIDFILE" from startproc call + (until startproc does allow to combine -f and -p again) + +------------------------------------------------------------------- +Fri Aug 22 16:42:20 CEST 2008 - prusnak@suse.cz + +- added -DWITH_SELINUX to DEFS + +------------------------------------------------------------------- +Thu Aug 21 01:52:40 CEST 2008 - ro@suse.de + +- remove outdated options from fillup_and_insserv call + +------------------------------------------------------------------- +Wed Aug 20 15:20:06 CEST 2008 - mkoenig@suse.de + +- enable SELinux support [fate#303662] + +------------------------------------------------------------------- +Wed Aug 13 15:25:44 CEST 2008 - mkoenig@suse.de + +- fix init script tags + +------------------------------------------------------------------- +Wed Jan 16 10:46:36 CET 2008 - mskibbe@suse.de + +- Fate #301837: CRON XLM Service Description Document + +------------------------------------------------------------------- +Tue Jan 8 13:16:38 CET 2008 - coolo@suse.de + +- let cron recommend postfix, so that the package solver knows + that one of the smtp_daemons is preferred by the distribution + in case the user has no further input on this (#351027) + +------------------------------------------------------------------- +Wed Dec 12 10:56:51 CET 2007 - mkoenig@suse.de + +- remove old *system* entries before database reload to avoid + comparing wrong mtimes. [#344667] + +------------------------------------------------------------------- +Mon Dec 10 13:19:01 CET 2007 - mkoenig@suse.de + +- prevent cron.monthly running twice in a month [#338474] + +------------------------------------------------------------------- +Wed Dec 5 15:47:53 CET 2007 - mkoenig@suse.de + +- revert last change, it was wrong [#346150] + +------------------------------------------------------------------- +Wed Nov 28 12:10:12 CET 2007 - mkoenig@suse.de + +- fix calculation of time difference in run-crons script + +------------------------------------------------------------------- +Tue Nov 27 17:03:55 CET 2007 - mkoenig@suse.de + +- fix problem with DAILY_TIME set to 00:00 + +------------------------------------------------------------------- +Wed Nov 7 10:57:07 CET 2007 - mkoenig@suse.de + +- add %fillup_prereq and %insserv_prereq to Prereq + +------------------------------------------------------------------- +Tue Oct 16 14:17:35 CEST 2007 - mkoenig@suse.de + +- move ac power test to the beginning of the run_crons script, + to avoid creation of the tmpdir [#333751] + +------------------------------------------------------------------- +Tue Jun 19 18:48:21 CEST 2007 - dmueller@suse.de + +- cron should depend on smtp + +------------------------------------------------------------------- +Wed Jun 13 17:56:42 CEST 2007 - mkoenig@suse.de + +- fix another cron.daily run twice bug [#283218] + +------------------------------------------------------------------- +Thu Mar 29 15:31:22 CEST 2007 - mkoenig@suse.de + +- Restrict hardlink check to avoid potential DOS attacks [#258372] + +------------------------------------------------------------------- +Fri Mar 9 12:47:22 CET 2007 - mkoenig@suse.de + +- use pid file for start/stop [#248163] + +------------------------------------------------------------------- +Tue Feb 16 10:31:20 CET 2007 - mkoenig@suse.de + +- avoid duplicate source of sysconfig [#244513] +- fix bug in run-crons, which lets cron.daily run twice + for certain values of DAILY_TIME [#244977] + +------------------------------------------------------------------- +Mon Feb 12 17:39:11 CET 2007 - mkoenig@suse.de + +- load database right after daemon awakes [#243020] + +------------------------------------------------------------------- +Fri Feb 9 11:40:30 CET 2007 - mkoenig@suse.de + +- use norootforbuild + +------------------------------------------------------------------- +Tue Feb 6 17:00:40 CET 2007 - mkoenig@suse.de + +- set PAM_TTY [#242586] + +------------------------------------------------------------------- +Wed Sep 27 14:27:22 CEST 2006 - mkoenig@suse.de + +- relax requirements on crontab permissions [#207645] + +------------------------------------------------------------------- +Fri Sep 1 14:22:21 CEST 2006 - kukuk@suse.de + +- Add pam_loginuid.so to PAM config + +------------------------------------------------------------------- +Wed Aug 23 11:39:42 CEST 2006 - mkoenig@suse.de + +- fixed segfault bug [#199153] + +------------------------------------------------------------------- +Mon May 29 16:49:48 CEST 2006 - kssingvo@suse.de + +- fixed priviledge escalation bug CVE-2006-2607 (bugzilla#178863) + +------------------------------------------------------------------- +Tue Mar 28 12:01:31 CEST 2006 - hvogel@suse.de + +- really enable PAM [#160426] + +------------------------------------------------------------------- +Sat Mar 11 15:00:45 CET 2006 - schwab@suse.de + +- Fix last change. + +------------------------------------------------------------------- +Tue Feb 28 17:40:43 CET 2006 - hvogel@suse.de + +- add $network to Should-Start of the init script to avoid + cron starting before network [#151141] + +------------------------------------------------------------------- +Wed Jan 25 21:35:13 CET 2006 - mls@suse.de + +- converted neededforbuild to BuildRequires + +------------------------------------------------------------------- +Mon Jan 16 14:08:14 CET 2006 - mmj@suse.de + +- Build with -fstack-protector + +------------------------------------------------------------------- +Mon Jan 16 12:40:06 CET 2006 - mmj@suse.de + +- Make editors which do not modify original also work [#143209] + +------------------------------------------------------------------- +Mon Jan 16 11:50:40 CET 2006 - mmj@suse.de + +- Add the possibility to log also successful jobs, and introduce + sysconfig variables to control this [#135619] + +------------------------------------------------------------------- +Mon Jan 16 11:34:00 CET 2006 - mmj@suse.de + +- Send mail as user executing the cronjob [#140905] + +------------------------------------------------------------------- +Sat Jan 14 22:21:42 CET 2006 - schwab@suse.de + +- Don't strip binaries. + +------------------------------------------------------------------- +Wed Jan 11 14:17:23 CET 2006 - mlasars@suse.de + +- changed run-crons to run cron.daily at a designated + time (#114761). + +------------------------------------------------------------------- +Tue Dec 6 14:18:20 CET 2005 - mmj@suse.de + +- Make sure SELinux is disabled + +------------------------------------------------------------------- +Thu Aug 25 13:56:56 CEST 2005 - kukuk@suse.de + +- Fix permission of installed PAM config file + +------------------------------------------------------------------- +Fri Jun 17 02:52:33 CEST 2005 - mmj@suse.de + +- Compile with -fpie, link with -pie + +------------------------------------------------------------------- +Wed Jun 15 11:25:56 CEST 2005 - mmj@suse.de + +- Remove LAuS + +------------------------------------------------------------------- +Thu May 12 17:26:33 CEST 2005 - meissner@suse.de + +- use RPM_OPT_FLAGS -Wno-comment + +------------------------------------------------------------------- +Wed Apr 27 10:36:49 CEST 2005 - mmj@suse.de + +- use find -cmin instead of -ctime in run-crons [#80435] +- use /etc/cron.{allow,deny} instead of + /var/spool/cron/{allow,deny} [#80273] + +------------------------------------------------------------------- +Mon Mar 7 14:32:07 CET 2005 - mmj@suse.de + +- ignore .svn directories [#71052] + +------------------------------------------------------------------- +Mon Mar 7 11:43:59 CET 2005 - mmj@suse.de + +- rm commands in /etc/crontab are redundant [#71017] + +------------------------------------------------------------------- +Fri Feb 25 15:47:30 CET 2005 - ro@suse.de + +- explicitly set permissions for /var/spool/cron{,/tabs} + +------------------------------------------------------------------- +Wed Jan 12 12:16:00 CET 2005 - kukuk@suse.de + +- Add PAM support + +------------------------------------------------------------------- +Mon Jan 10 11:46:55 CET 2005 - mmj@suse.de + +- Don't source /etc/rc.status twice [#49673] + +------------------------------------------------------------------- +Fri Oct 1 15:48:21 CEST 2004 - mmj@suse.de + +- Add the old SuSE patch to be able to specify a "-" before a cron- + tab entry and then disable logging [#45611] + +------------------------------------------------------------------- +Thu Sep 30 13:04:16 CEST 2004 - mmj@suse.de + +- Add correct permissions handling +- Fix swap_uids_back() function + +------------------------------------------------------------------- +Wed Sep 22 10:12:49 CEST 2004 - mmj@suse.de + +- Remove selinux support since it's broken at the moment [#45611] + +------------------------------------------------------------------- +Tue Sep 14 17:32:59 CEST 2004 - mmj@suse.de + +- Make run-crons up to date with laptops ac stuff [#45248] + +------------------------------------------------------------------- +Tue Sep 14 01:17:01 CEST 2004 - ro@suse.de + +- make laus stuff conditional + +------------------------------------------------------------------- +Tue Aug 31 16:18:52 CEST 2004 - mmj@suse.de + +- Remove update functionality from the last millenium +- Clean out notify mails [#44347] +- Clean up spec file a bit + +------------------------------------------------------------------- +Tue Aug 31 07:45:27 CEST 2004 - mmj@suse.de + +- Add patch to be more relaxed with permissions [#44304] [#44470] + +------------------------------------------------------------------- +Wed Aug 25 11:04:26 CEST 2004 - thomas@suse.de + +- added laus patch + +------------------------------------------------------------------- +Tue Aug 24 19:20:32 CEST 2004 - mmj@suse.de + +- New cron has slightly changed semantics, so invoke process_crontab + correctly and make system crontabs works again + +------------------------------------------------------------------- +Mon Aug 23 20:19:10 CEST 2004 - mmj@suse.de + +- Add missing hunk to control when we reload the db +- Remove laus and laus-devel from neededforbuild for now +- Use same pathnames as before + +------------------------------------------------------------------- +Mon Aug 23 14:33:33 CEST 2004 - mmj@suse.de + +- Call make in %build allthough make install implies it's built + +------------------------------------------------------------------- +Mon Aug 23 11:50:42 CEST 2004 - mmj@suse.de + +- Update to vixie cron 4.1: + o Adapt many Fedora patches including what we had in our + cron-3.0.1 patches + o Add SELinux support + o Add debugging info +- LAuS support for now disabled, will be enabled later + +------------------------------------------------------------------- +Tue Apr 6 07:06:26 CEST 2004 - kukuk@suse.de + +- fix permissions of crontab + +------------------------------------------------------------------- +Fri Mar 26 14:39:45 CET 2004 - thomas@suse.de + +- cosmetic changes in spec file (inspired by mmj) +- ironed out hunk shift due to changed line offset in laus + patch + +------------------------------------------------------------------- +Wed Mar 24 17:41:58 CET 2004 - thomas@suse.de + +- made LAuS support work on x86_64 + +------------------------------------------------------------------- +Tue Mar 23 16:53:23 CET 2004 - thomas@suse.de + +- added LAuS patch + +------------------------------------------------------------------- +Thu Oct 2 11:09:58 CEST 2003 - fehr@suse.de + +- fix wrong nice level of cron scripts (#31961) + +------------------------------------------------------------------- +Thu Sep 18 02:03:17 CEST 2003 - ro@suse.de + +- fix typo in run-crons (#31216) + +------------------------------------------------------------------- +Tue Aug 26 17:30:59 CEST 2003 - mmj@suse.de + +- Don't do it all in the 0'th hour, but the 4th + +------------------------------------------------------------------- +Sat Aug 16 19:23:05 CEST 2003 - kukuk@suse.de + +- Modify /etc/crontab only if we need to move cron directory +- Try to restart daemon on update + +------------------------------------------------------------------- +Thu Jul 3 17:44:44 CEST 2003 - fehr@suse.de + +- fix bug in handling of monthly script in /usr/lib/cron/run-crons + (#27704) +- adapt sigcld handling for new kernel (#26011) + +------------------------------------------------------------------- +Tue May 27 04:53:46 CEST 2003 - sndirsch@suse.de + +- /usr/lib/cron/run-crons: added missing "-n" to specify nice level + +------------------------------------------------------------------- +Tue May 6 10:32:36 CEST 2003 - fehr@suse.de + +- Fix bug in quoting patch (#26675) + +------------------------------------------------------------------- +Wed Apr 16 09:15:19 CEST 2003 - coolo@suse.de + +- use BuildRoot + +------------------------------------------------------------------- +Mon Mar 24 10:37:25 CET 2003 - fehr@suse.de + +- Add improved version of cron_number_check.patch from Gernot Payer + +------------------------------------------------------------------- +Thu Mar 20 15:36:35 CET 2003 - fehr@suse.de + +- Fix wrong check for number, thanks to Gernot Payer + (#25680) + +------------------------------------------------------------------- +Fri Feb 28 09:31:00 CET 2003 - fehr@suse.de + +- Fix quoting problem with % in crontab, thanks to Klaus G. Wagner + (#17713) + +------------------------------------------------------------------- +Thu Feb 13 13:46:50 CET 2003 - mmj@suse.de + +- Do not own /etc/cron.d* since we might want to use other cron + versions. + +------------------------------------------------------------------- +Tue Nov 5 14:07:54 CET 2002 - ro@suse.de + +- fixed bogus self-provides + +------------------------------------------------------------------- +Tue Nov 5 14:06:57 CET 2002 - ro@suse.de + +- fixed typo in run-crons script (ouput->output) (#21497) + +------------------------------------------------------------------- +Thu Aug 15 12:11:42 CEST 2002 - fehr@suse.de + +- add PreReq tag to spec file + +------------------------------------------------------------------- +Mon Aug 5 09:25:02 CEST 2002 - kukuk@suse.de + +- Use $time instead of xntpd +- Make sendmail/postfix "Should-Start" + +------------------------------------------------------------------- +Wed Jul 3 01:23:41 MEST 2002 - draht@suse.de + +- crontab(1) must not leak fd for /var/spool/cron/deny and/or + /var/spool/cron/allow to the user's editor (security). + +------------------------------------------------------------------- +Thu Apr 25 15:19:31 CEST 2002 - fehr@suse.de + +- added newline to run-cron output (#15796) + +------------------------------------------------------------------- +Fri Mar 1 14:46:16 CET 2002 - egmont@suselinux.hu + +- fix month/day interval in manpage + +------------------------------------------------------------------- +Thu Feb 21 10:46:21 CET 2002 - ro@suse.de + +- logger is in /bin, adapt run-crons script + +------------------------------------------------------------------- +Mon Feb 4 11:36:37 CET 2002 - fehr@suse.de + +- fix reload option of init-script (#13026) + +------------------------------------------------------------------- +Thu Jan 24 10:15:55 CET 2002 - ro@suse.de + +- modified fillup_and_insserv call (perl-hack not needed here) + +------------------------------------------------------------------- +Fri Jan 18 00:45:15 CET 2002 - ro@suse.de + +- fixed initscript comments + +------------------------------------------------------------------- +Thu Jan 10 14:24:52 CET 2002 - ro@suse.de + +- removed test for CRON variable from init script + +------------------------------------------------------------------- +Wed Dec 12 17:07:57 CET 2001 - fehr@suse.de + +- fix wrong sigchld handling (thanks to Philip Willoughby) +- changed to new init script handling + +------------------------------------------------------------------- +Fri Sep 28 16:39:59 CEST 2001 - ro@suse.de + +- removed duplicate trap in run-crons (#11472) + +------------------------------------------------------------------- +Thu Sep 13 16:23:03 CEST 2001 - ro@suse.de + +- updated run-crons (feedback from volker_apelt, thanks) + +------------------------------------------------------------------- +Fri Sep 7 18:00:38 CEST 2001 - schwab@suse.de + +- Instead of closing std{in,out,err} redirect them to /dev/null. + +------------------------------------------------------------------- +Wed Aug 15 11:30:47 CEST 2001 - fehr@suse.de + +- add log messages when one of the /etc/cron/cron.* scripts fails + (thanks for suggestion by Steffen Dettmer) + +------------------------------------------------------------------- +Mon May 7 19:00:55 MEST 2001 - draht@suse.de + +- Added security patch for a wrong setuid() call. + +------------------------------------------------------------------- +Tue Apr 24 11:06:31 CEST 2001 - ro@suse.de + +- added rc-link + +------------------------------------------------------------------- +Mon Apr 23 16:59:30 CEST 2001 - ro@suse.de + +- added updated startscript and rc.config variable + +------------------------------------------------------------------- +Thu Apr 12 14:02:35 CEST 2001 - werner@suse.de + +- Close stdin, stdout, and stderr on forking of the daemon. + +------------------------------------------------------------------- +Wed Feb 14 14:55:26 MET 2001 - fehr@suse.de + +- add patch to prevent buffer overflow with usernames longer than + 19 characters + +------------------------------------------------------------------- +Tue Feb 6 10:13:27 MET 2001 - fehr@suse.de + +- Make it compile with new glibc +- remove calls to fax utilities and texpire from default crontab + +------------------------------------------------------------------- +Tue Dec 12 17:07:17 CET 2000 - werner@suse.de + +- Add cron.hourly because we provide /etc/cron.hourly/ +- Remove lock files not at same time but with a quater offset +- Don't run *.rpmorig, *.rpmnew, *.rmpsave, *.swap, *.bak, *~, #* +- Don run a script if it is already running +- Remove `echo' to enable DTS patch of Thomas + +------------------------------------------------------------------- +Fri Dec 8 11:35:16 MET 2000 - fehr@suse.de + +- fix bug introduced in last change + +------------------------------------------------------------------- +Mon Nov 20 16:02:06 MET 2000 - fehr@suse.de + +- add security patch from Daniel Jacobowitz to cron +- prevent cron.daily called twice when changing from DST to normal (#998) + +------------------------------------------------------------------- +Wed Nov 15 18:15:59 MET 2000 - fehr@suse.de + +- add most of the patches of Chris D. Faulhaber (jedgar@fxp.org) (#4249) + +------------------------------------------------------------------- +Tue Sep 5 16:49:14 MEST 2000 - fehr@suse.de + +- make sematic of cron.monthly clearer. It is now executed on the + first check in run-crons executed in a month but at most once + per month. Older semantic was to execute every 30 days which + resulted in being called twice per month when month has 31 days + and first execution was on 1st day of month. (#3850) + +------------------------------------------------------------------- +Fri Jul 21 14:20:45 MEST 2000 - fehr@suse.de + +- fix the use of ifdef __linux__ (everywhere else __linux is used) + +------------------------------------------------------------------- +Wed May 31 10:39:17 MEST 2000 - fehr@suse.de + +- Start script with "nice -15" + +------------------------------------------------------------------- +Mon May 22 15:44:36 CEST 2000 - kukuk@suse.de + +- Fix post install section + +------------------------------------------------------------------- +Tue May 16 15:47:56 CEST 2000 - kukuk@suse.de + +- Move /var/cron -> /var/spool/cron (FHS 2.1) + +------------------------------------------------------------------- +Sun Feb 27 15:48:47 CET 2000 - kukuk@suse.de + +- Move /usr/man -> /usr/share/man + +------------------------------------------------------------------- +Mon Jan 24 19:25:24 CET 2000 - uli@suse.de + +- added -D__linux to cope with gcc 2.95 + +------------------------------------------------------------------- +Thu Dec 2 12:27:05 CET 1999 - bs@suse.de + +- removed CDR_PROG section from run-crons. this leads to problems in + some network environments. + + +------------------------------------------------------------------- +Mon Sep 20 17:58:32 CEST 1999 - ro@suse.de + +- added Requires smtp_daemon + +------------------------------------------------------------------- +Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de + +- ran old prepare_spec on spec file to switch to new prepare_spec. + +------------------------------------------------------------------- +Mon Aug 30 10:13:42 MEST 1999 - kukuk@suse.de + +- always use fork instead of vfork + +------------------------------------------------------------------- +Fri Aug 27 17:23:30 MEST 1999 - fehr@suse.de + +- prevent sendmail from being called as root + +------------------------------------------------------------------- +Thu Aug 26 11:49:44 MEST 1999 - fehr@suse.de + +- fixed some possible buffer overflow exploits + +------------------------------------------------------------------- +Fri Jul 23 18:02:55 MEST 1999 - bs@suse.de + +- redirect stderr of apm call to /dev/null + +------------------------------------------------------------------- +Thu Jul 15 17:12:49 MEST 1999 - bs@suse.de + +- don't run cron jobs via run-cron if + o a cd writer is running + o laptop is AC-offline + +- /etc/crontab: + o don't log every start of run-crons + o run faxclean only once a day + +------------------------------------------------------------------- +Mon Mar 29 18:12:24 MEST 1999 - ro@suse.de + +- added cron.d feature from debian-cron + +------------------------------------------------------------------- +Mon Feb 1 13:11:13 MET 1999 - bs@suse.de + +- merged beta and stable version +- added entries in crontab to delete lastrun files, to let cronjobs be started + at night. + +------------------------------------------------------------------- +Fri Jan 8 16:15:54 MET 1999 - bs@suse.de + +- changed run-crons to work around finds 'strange behavior' + +------------------------------------------------------------------- +Fri Dec 18 15:33:59 MET 1998 - ro@suse.de + +- use SIGCHLD instead of SIGCLD + + +------------------------------------------------------------------- +Tue Dec 15 01:06:31 MET 1998 - bs@suse.de + +- fixed xargs in run-crons + +------------------------------------------------------------------- +Mon Dec 14 13:25:24 MET 1998 - bs@suse.de + +- fixed bug in run-crons + +------------------------------------------------------------------- +Mon Dec 14 05:10:31 MET 1998 - bs@suse.de + +- added /etc/cron.* feature. + +------------------------------------------------------------------- +Tue Nov 17 20:42:58 MET 1998 - bs@suse.de + +- added texpire to crontab. +- use noreplace for config files. + +------------------------------------------------------------------- +Thu Sep 10 16:39:44 MEST 1998 - bs@suse.de + +- fixed problem with non existing var/cron/tabs/root. + +------------------------------------------------------------------- +Mon Sep 7 11:53:57 MEST 1998 - bs@suse.de + +- fixed check for /var/cron/tabs/root in %post section + +---------------------------------------------------------------------------- +Mon Jul 7 13:17:08 CEST 1997 - florian@suse.de + + +- warn if cron.daily is still in /var/cron/tabs/root + +- start cron.daily 10 minutes earlier, so that duplicate + entries don't overlap :-( + + + +---------------------------------------------------------------------------- +Thu Jun 5 11:08:05 MEST 1997 - florian@suse.de + + +- use /etc/crontab instead of /var/cron/tabs/root + + +---------------------------------------------------------------------------- +Fri May 16 01:31:24 CEST 1997 - bs@suse.de + +- removed *.new -> orig stuff behavior, since is not neded for rpm. + +---------------------------------------------------------------------------- +Wed Apr 30 15:57:14 CEST 1997 - florian@suse.de + + +- fix screen output ifrom ALLOW_FILE to DENY_FILE + +- do not include syslog.c anymore, libc is fixed + +- disable debugging compile time switch + +- add some security patches + + +---------------------------------------------------------------------------- +Thu Feb 27 12:30:11 CET 1997 - bs@suse.de + +added crontab entries for hylafax. + +---------------------------------------------------------------------------- +Wed Jan 22 22:24:11 CET 1997 - florian@suse.de + + +- syslogging works even if syslogd is restarted + + +---------------------------------------------------------------------- +Wed Nov 13 03:08:18 MET 1996 - bs@suse.de + +- beautified man page +- store crontab.root.new in /root instead of /tmp + +---------------------------------------------------------------------- +Tue Sep 24 09:27:17 MET DST 1996 - bs@suse.de + +- atrun aus crontab fur root rausgenommen. diff --git a/cronie.spec b/cronie.spec new file mode 100644 index 0000000..65d276c --- /dev/null +++ b/cronie.spec @@ -0,0 +1,252 @@ +# +# spec file for package cronie +# +# Copyright (c) 2022 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define cron_configs %{_sysconfdir}/pam.d/crond %{_sysconfdir}/crontab %{_sysconfdir}/cron.deny +#Compat macro for new _fillupdir macro introduced in Nov 2017 +%if ! %{defined _fillupdir} + %define _fillupdir %{_localstatedir}/adm/fillup-templates +%endif +Name: cronie +Version: 1.6.1 +Release: 0 +Summary: Cron Daemon +License: BSD-3-Clause AND GPL-2.0-only AND MIT +Group: System/Daemons +URL: https://github.com/cronie-crond/%{name} +Source0: https://github.com/cronie-crond/%{name}/archive/%{name}-%{version}.tar.gz +Source2: run-crons +Source3: sample.root +Source4: deny.sample +Source7: cron_to_cronie.README +Source8: cron.service +Source9: sysconfig.cron +# PATCH-FEATURE-OPENSUSE cronie-pam_config.diff added pam config file from old cron +Patch3: cronie-pam_config.diff +# openSUSE set NHEADER_LINES to 3 - old openSUSE cron put three lines of comments +# in top of crontab file, so we want to hide this junk comments if user edit +# crontab file with crontab -e command, patch grabbed from old openSUSE cron +Patch4: cronie-nheader_lines.diff +# we use cron.pid instead of crond.pid +Patch5: cronie-crond_pid.diff +# 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. +Patch13: fix-manpage-replace-anacrontab-with-crontab.patch +BuildRequires: audit-devel +BuildRequires: autoconf +BuildRequires: automake +BuildRequires: libselinux-devel +BuildRequires: pam-devel +BuildRequires: pkgconfig +BuildRequires: pkgconfig(systemd) +Requires: mail +Requires(post): %fillup_prereq +Requires(post): debianutils +Requires(post): permissions +Requires(pre): cron +Suggests: mailx +Conflicts: cron <= 4.1 +%{?systemd_requires} +# This is needed as cron subpkg has its own version +%{expand: %%define cronie_version %{version}} +%if 0%{?suse_version} >= 1330 +Requires(pre): group(trusted) +%endif + +%description +cron automatically starts programs at specific times. Add new entries +with "crontab -e". (See "man 5 crontab" and "man 1 crontab" for +documentation.) + +Under /etc, find the directories cron.hourly, cron.daily, cron.weekly, +and cron.monthly. Scripts and programs that are located there are +started automatically. + +%package -n cron +Version: 4.2 +Release: 0 +Summary: Auxiliary package +Group: System/Daemons +Requires: %{name} = %{cronie_version}-%{release} +Requires(post): permissions + +%description -n cron +Auxiliary package, needed for proper update from vixie-cron 4.1 to cronie 1.4.4 + +%package anacron +Summary: Utility for running regular jobs +Group: System/Base +Requires: %{name} = %{cronie_version} + +%description anacron +Anacron becames part of cronie. Anacron is used only for running regular jobs. +The default settings execute regular jobs by anacron, however this could be +overloaded in settings. + +%prep +%setup -q -n %{name}-%{name}-%{cronie_version} +%patch3 -p1 +%patch4 +%patch5 -p1 +cp %{SOURCE7} ./cron_to_cronie.README +%patch13 -p1 + +%build +# fill macro CRON_VERSION it is used in top three lines of crontab file,should be reworked +export CFLAGS="%{optflags} -DCRON_VERSION=\\\"%{version}\\\"" +export LDFLAGS="-Wl,-z,relro,-z,now,-z,defs" +autoreconf -f -i +%configure \ + --with-audit \ + --enable-anacron \ + --with-pam \ + --with-selinux \ + --with-inotify \ + --enable-pie \ + SPOOL_DIR="%{_localstatedir}/spool/cron/tabs" +%make_build + +%install +%make_install +mkdir -p -v %{buildroot}%{_localstatedir}/spool/cron/{tabs,lastrun} +mkdir -p -v %{buildroot}%{_sysconfdir}/cron.{d,hourly,daily,weekly,monthly} +install -v -m 600 %{SOURCE3} %{buildroot}%{_sysconfdir}/crontab +install -v -m 600 %{SOURCE4} %{buildroot}%{_sysconfdir}/cron.deny +install -v -d %{buildroot}%{_libexecdir}/cron +install -v %{SOURCE2} %{buildroot}%{_libexecdir}/cron +ln -s -f %{_sbindir}/service %{buildroot}%{_sbindir}/rccron +install -v -d %{buildroot}/%{_unitdir} +install -v -m 644 %{SOURCE8} %{buildroot}/%{_unitdir} +install -m 644 contrib/anacrontab %{buildroot}%{_sysconfdir}/anacrontab +install -c -m755 contrib/0anacron %{buildroot}%{_sysconfdir}/cron.hourly/0anacron +mkdir -p %{buildroot}%{_localstatedir}/spool/anacron +mv %{buildroot}%{_sbindir}/crond %{buildroot}%{_sbindir}/cron +mkdir -p %{buildroot}%{_fillupdir} +cp %{SOURCE9} %{buildroot}%{_fillupdir}/ + +mkdir -p %{buildroot}%{_sysconfdir}/cron.d +mkdir -p %{buildroot}%{_sysconfdir}/cron.hourly +mkdir -p %{buildroot}%{_sysconfdir}/cron.daily +mkdir -p %{buildroot}%{_sysconfdir}/cron.weekly +mkdir -p %{buildroot}%{_sysconfdir}/cron.monthly + +touch %{buildroot}%{_localstatedir}/spool/anacron/cron.daily +touch %{buildroot}%{_localstatedir}/spool/anacron/cron.weekly +touch %{buildroot}%{_localstatedir}/spool/anacron/cron.monthly + +%if 0%{?suse_version} > 1500 +mkdir -p %{buildroot}%{_pam_vendordir} +mv %{buildroot}%{_sysconfdir}/pam.d/crond %{buildroot}%{_pam_vendordir}/ +%endif + +%pre +%if 0%{?suse_version} > 1500 +# Prepare for migration to /usr/etc; save any old .rpmsave +for i in pam.d/crond ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||: +done +%endif +%service_add_pre cron.service + +%post +%set_permissions %{_sysconfdir}/crontab %{_bindir}/crontab +%{fillup_only -n cron} +%service_add_post cron.service +exit 0 + +%if 0%{?suse_version} > 1500 +%posttrans +# Migration to /usr/etc, restore just created .rpmsave +for i in pam.d/crond ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||: +done +%endif + +%verifyscript +%verify_permissions -e %{_sysconfdir}/crontab -e %{_bindir}/crontab + +%preun +%service_del_preun cron.service + +%postun +%service_del_postun cron.service + +%post anacron +[ -e %{_localstatedir}/spool/anacron/cron.daily ] || touch %{_localstatedir}/spool/anacron/cron.daily +[ -e %{_localstatedir}/spool/anacron/cron.weekly ] || touch %{_localstatedir}/spool/anacron/cron.weekly +[ -e %{_localstatedir}/spool/anacron/cron.monthly ] || touch %{_localstatedir}/spool/anacron/cron.monthly + +%verifyscript -n cron +%verify_permissions -e %{_sysconfdir}/cron.d/ +%verify_permissions -e %{_sysconfdir}/cron.daily/ +%verify_permissions -e %{_sysconfdir}/cron.hourly/ +%verify_permissions -e %{_sysconfdir}/cron.monthly/ +%verify_permissions -e %{_sysconfdir}/cron.weekly/ + +%post -n cron +%set_permissions %{_sysconfdir}/cron.d/ +%set_permissions %{_sysconfdir}/cron.daily/ +%set_permissions %{_sysconfdir}/cron.hourly/ +%set_permissions %{_sysconfdir}/cron.monthly/ +%set_permissions %{_sysconfdir}/cron.weekly/ + +%files +%license COPYING +%doc AUTHORS README ChangeLog +%dir %attr(700,root,root) %{_localstatedir}/spool/cron +%dir %attr(700,root,root) %{_localstatedir}/spool/cron/tabs +%dir %{_localstatedir}/spool/cron/lastrun +%if 0%{?suse_version} > 1500 +%{_pam_vendordir}/crond +%else +%config %{_sysconfdir}/pam.d/crond +%endif +%verify(not mode) %config(noreplace) %{_sysconfdir}/crontab +%config(noreplace) %{_sysconfdir}/cron.deny +%{_mandir}/man1/crontab.1%{?ext_man} +%{_mandir}/man5/crontab.5%{?ext_man} +%{_mandir}/man8/cron.8%{?ext_man} +%{_mandir}/man8/crond.8%{?ext_man} +%{_mandir}/man1/cronnext.1%{?ext_man} +%verify(not mode) %attr (4750,root,trusted) %{_bindir}/crontab +%attr (755,root,root) %{_sbindir}/cron +%attr (755,root,root) %{_bindir}/cronnext +%{_sbindir}/rccron +%{_libexecdir}/cron +%{_unitdir}/cron.service +%{_fillupdir}/sysconfig.cron + +%files anacron +%{_sbindir}/anacron +%attr(0755,root,root) %{_sysconfdir}/cron.hourly/0anacron +%config(noreplace) %{_sysconfdir}/anacrontab +%dir %{_localstatedir}/spool/anacron +%ghost %verify(not md5 size mtime) %{_localstatedir}/spool/anacron/cron.daily +%ghost %verify(not md5 size mtime) %{_localstatedir}/spool/anacron/cron.weekly +%ghost %verify(not md5 size mtime) %{_localstatedir}/spool/anacron/cron.monthly +%{_mandir}/man5/anacrontab.5%{?ext_man} +%{_mandir}/man8/anacron.8%{?ext_man} + +%files -n cron +%doc cron_to_cronie.README +%dir %attr(755,root,root) %{_sysconfdir}/cron.d +%dir %attr(755,root,root) %{_sysconfdir}/cron.hourly +%dir %attr(755,root,root) %{_sysconfdir}/cron.daily +%dir %attr(755,root,root) %{_sysconfdir}/cron.weekly +%dir %attr(755,root,root) %{_sysconfdir}/cron.monthly + +%changelog diff --git a/deny.sample b/deny.sample new file mode 100644 index 0000000..b6fd878 --- /dev/null +++ b/deny.sample @@ -0,0 +1 @@ +guest diff --git a/fix-manpage-replace-anacrontab-with-crontab.patch b/fix-manpage-replace-anacrontab-with-crontab.patch new file mode 100644 index 0000000..7f04047 --- /dev/null +++ b/fix-manpage-replace-anacrontab-with-crontab.patch @@ -0,0 +1,27 @@ +From 8769bba06b1632c6bd275f88c0fd10f591efdb9b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Krist=C3=BDna=20Streitov=C3=A1?= +Date: Mon, 22 Sep 2014 10:41:14 +0200 +Subject: [PATCH] fix manpage replace anacrontab with crontab + +/etc/anacrontab replaced by /etc/crontab in the first occurance of it. +Fixes bnc#833240 +--- + man/cron.8 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/man/cron.8 b/man/cron.8 +index 633dbc0..9716f8f 100644 +--- a/man/cron.8 ++++ b/man/cron.8 +@@ -53,7 +53,7 @@ for crontab files which are named after accounts in + The found crontabs are loaded into the memory. + .I Cron + also searches for +-.I /etc/anacrontab ++.I /etc/crontab + and any files in the + .I /etc/cron.d + directory, which have a different format (see +-- +1.8.4.5 + diff --git a/run-crons b/run-crons new file mode 100644 index 0000000..c564cd2 --- /dev/null +++ b/run-crons @@ -0,0 +1,304 @@ +#!/bin/bash +# +# /usr/libexec/cron/run-crons +# +# Copyright (c) 1998-2001 SuSE GmbH Nuernberg, Germany. All rights reserved. +# +# this script looks into /etc/cron.{hourly,daily,weekly,monthly} for +# scripts to be executed. The info about last run is stored in +# /var/spool/cron/lastrun +# +# concept similar to debian and redhat +# +# Changes: +# 1998 - Burchard Steinbild , 1998 +# initial version +# before 2001 - va@org.chemie.uni-frankfurt.de +# send an email with name of date-script instead of cron entry +# "Subject: cronjob@www - daily - FAILURE" +# (better one script for each date-sub-script) +# requires changes to /etc/crontab +# append > /dev/null 2>&1 to the line calling run-cons +# 2001-09-11 +# updated to Suse 7.2 merged +# 2001-09-12 +# changed FAILURE detection, until now all scripts with output +# had "failed", now only scripts with error status != 0 +# have failed. +# 2001-09-13 - ro@suse.de +# merged with 7.3: call logger with exit value for scripts +# respect MAILTO as cron does +# use mktemp -d for all tmpfiles +# add variable to disable mail if all jobs returned 0 +# 2015-06-25 - jmatejek@suse.com +# bnc#812367 support MAILFROM as cron does +# 2016-08-08 - tchvatal@suse.com +# bnc#983925 run crons even on battery +# 2017-10-24 - jsegitz@suse.de +# bsc#1062722 - harden run-cron to ensure correct directory permissions + +if [ -f /etc/sysconfig/cron ]; then + . /etc/sysconfig/cron +fi + +BASENAME=`/usr/bin/basename $0` +LOGGER="/bin/logger -t $BASENAME[$$]" + +export LC_TIME=POSIX +TMPDIR=`mktemp -d /tmp/run-crons.XXXXXX` +trap "rm -rf $TMPDIR" 0 1 2 3 13 15 + +# We will force to run cron.daily after 14 days, even +# if you set MAX_NOT_RUN in /etc/sysconfig/cron +# value is in minutes +MAX_NOT_RUN_FORCE="20160" + +# Priority change for sub scripts. +# range: highest -20 ... 19 lowest prioriy +# default processes start in level 10 +CRON_SCRIPT_NICE_VALUE=15 +SPOOL=/var/spool/cron/lastrun + +# CRON Result EMail is sent to +if [ -z "$MAILTO" ]; then + SEND_TO="root" +else + SEND_TO="$MAILTO" +fi + +if [ -z "$MAILFROM" ]; then + SEND_FROM="root" +else + SEND_FROM="$MAILFROM" +fi + +# XXX support external specification of $MAILER? +for POSSIBLE_MAILER in /usr/bin/mail /usr/lib/sendmail /usr/bin/mailx /usr/sbin/sendmail; do + test -x $POSSIBLE_MAILER && MAILER=$POSSIBLE_MAILER +done +if [ -z "$MAILER" ]; then + echo "Could not find suitable mailer." + exit 1 +fi + +export MAIL_CONFIG +export MAILER + +function send_email() { + SUBJECT="$1"; shift + TMP=`mktemp` + echo "Subject: $SUBJECT" > "$TMP" + echo "From: $SEND_FROM" >> "$TMP" + echo "To: $SEND_TO" >> "$TMP" + echo >> "$TMP" + cat "$@" >> "$TMP" + "$MAILER" -r "$SEND_FROM" "$SEND_TO" < "$TMP" + rm -f "$TMP" +} + +mkdir -p $SPOOL + +#set verbose +## stage 1, search directories/scripts to run +RUN="" +SECURE_PERMISSIONS="${SECURE_DIR_PERMISSIONS:-755}" +for CRONDIR in /etc/cron.{hourly,daily,weekly,monthly} ; do + test -d $CRONDIR || continue + # this is racy but better than nothing + if [ ! "$ENFORCE_ROOT_OWNER_GROUP_DIR" = "no" ] && [ ! -O $CRONDIR -o ! -G $CRONDIR ]; then + echo "wrong owner/group for $CRONDIR, skipping" | logger + continue + fi + ACTUAL_PERMISSIONS=$(stat -c %a $CRONDIR) + # to have this default to false would be better, but would require a more + # complicated logic in the loop + PERMISSIONS_ARE_SECURE=true + for (( i=0; i<${#ACTUAL_PERMISSIONS}; i++ )); do + if [ "${ACTUAL_PERMISSIONS:$i:1}" -gt "${SECURE_PERMISSIONS:$i:1}" ]; then + PERMISSIONS_ARE_SECURE=false + fi + done + if [ ! "$PERMISSIONS_ARE_SECURE" = true ]; then + echo "wrong permissions $ACTUAL_PERMISSIONS for $CRONDIR, expecting $SECURE_PERMISSIONS. Skipping" | logger + continue + fi + + BASE=${CRONDIR##*/} + TIME_EXT=${BASE##cron.} + + test -e $SPOOL/$BASE && { + case $BASE in + cron.hourly) TIME="-cmin +60 -or -cmin 60" ;; + cron.daily) + # if DAILY_TIME set, run only at a fixed time of day + if [ "$DAILY_TIME" != "" ] ; then + DAILY_TIME_NEW="`echo $DAILY_TIME | sed s,:,, | sed s,^0\*,, `" + test -z "$DAILY_TIME_NEW" && DAILY_TIME_NEW=0 + if [ "$DAILY_TIME_NEW" -gt "2359" ] ; then + echo "wrong time format in /etc/sysconfig/cron DAILY_TIME, value is $DAILY_TIME" | logger + fi + NOW_H=`date +%H%M| sed s,^0\*,,` + test -z "$NOW_H" && NOW_H=0 + if [ $DAILY_TIME_NEW -gt $(($NOW_H-15)) ] && [ $DAILY_TIME_NEW -le $NOW_H ]; then + TIME="" + else + # take care of MAX_NOT_RUN, default is 7 days + if [ "$MAX_NOT_RUN" != "0" ] ; then + TIME="-cmin +$((1440*$MAX_NOT_RUN)) -or -cmin $((1440*$MAX_NOT_RUN))" + else + TIME="-cmin +$MAX_NOT_RUN_FORCE -or -cmin $MAX_NOT_RUN_FORCE" + fi + fi + + # run as usual + else + TIME="-cmin +1440 -or -cmin 1440" + fi ;; + cron.weekly) TIME="-cmin +10080 -or -cmin 10080" ;; + cron.monthly) + DAYOFMONTH=`date '+%d'` + DAYSLASTMONTH=`date -d "-$DAYOFMONTH days" '+%d'` + if [ $DAYOFMONTH -gt $DAYSLASTMONTH ] ; then + LASTMONTHSTR="-$DAYOFMONTH days" + else + LASTMONTHSTR="last month" + fi + NOW=`date +%s` + LASTMONTH=`date -d "$LASTMONTHSTR" +%s` + DIFF=`expr '(' $NOW - $LASTMONTH ')' / 86400` + TIME="-ctime +$DIFF" + ;; + esac + # remove all lock files for scripts that are due to run + eval find $SPOOL/$BASE $TIME | \ + xargs --no-run-if-empty rm + } + if test ! -e $SPOOL/$BASE ; then + # accept this dir, if it isn't empty + LIST=`find $CRONDIR ! -type d` + if [ ! -z "$LIST" ] ; then + RUN="${RUN} ${TIME_EXT}" + fi + fi +done + + +## STATUS communication variable between +# function run_scripts () +# and loop-over-all-scripts +# set in run_scripts to FAILURE if this script failed! +# else it is empty +# because it is never reset to empty after the initialization +# it implements an OR like logic over all scripts +## +STATUS="" + +# helper, run all scripts in one cron directory +function run_scripts (){ + local CRONDIR=$1 + local TIME_EXT=$2 + + + local TEMP_MSG=$TMPDIR/run-crons.${TIME_EXT}.$$ + rm -r $TMPDIR/run-crons.${TIME_EXT}.* >/dev/null 2>&1 + + # keep going when something fails + set +e + for SCRIPT in $CRONDIR/* ; do + test -d $SCRIPT && continue + case "$SCRIPT" in + .svn) continue ;; + *.rpm*) continue ;; + *.swap) continue ;; + *.bak) continue ;; + *.orig) continue ;; + \#*) continue ;; + *~) continue ;; + esac + if test -x $SCRIPT ; then + BASESCRIPT=`/usr/bin/basename $SCRIPT` + + nice -n ${CRON_SCRIPT_NICE_VALUE} $SCRIPT >$TEMP_MSG 2>&1 + + local ERRNO=$? + if [ 0 -eq $ERRNO ] ; then + if [ "$SYSLOG_ON_NO_ERROR" = "yes" ]; then + echo "$BASESCRIPT: OK" | $LOGGER -p info + fi + else + echo "$BASESCRIPT returned $ERRNO" | $LOGGER -p warn + echo "SCRIPT: $BASESCRIPT exited with RETURNCODE = $ERRNO." + STATUS="FAILURE" + fi + # write some wrapper text around the original output + if [ -s "$TEMP_MSG" ] ; then + echo "SCRIPT: output (stdout && stderr) follows" + echo "" + cat $TEMP_MSG + echo -e "SCRIPT: $BASESCRIPT\n------- END OF OUTPUT" + echo "" + echo "" + fi + + rm -f $TEMP_MSG > /dev/null 2>&1 + else + echo "WARNING: $SCRIPT is not executable, script is ignored !" + fi + done +} + +# stage 2: +# run all scripts and collect output into one mail +# for each TIME_EXT with a meaningfull subject. +# +if [ ! -z "${RUN}" ] ; then + for EXT in ${RUN} ; do + CRONDIR="/etc/cron."${EXT} + test -d $CRONDIR || continue + BASE=`/usr/bin/basename $CRONDIR` + TIME_EXT=${BASE##cron.} + STATUS="" + + if test ! -e $SPOOL/$BASE ; then + CONTROL_MAIL=$TMPDIR/run-crons_mail.$$ + JOB_OUTPUT=$TMPDIR/run-crons_output.$$ + + echo "running ${TIME_EXT} cronjob scripts" >> ${CONTROL_MAIL} + echo "" >> ${CONTROL_MAIL} + + touch $SPOOL/$BASE + + run_scripts ${CRONDIR} ${TIME_EXT} >> ${JOB_OUTPUT} 2>&1 + TITLE="cronjob@$HOSTNAME - ${TIME_EXT}" + if [ -n "${STATUS}" ] ; then + TITLE="${TITLE} - ${STATUS}" + else + TITLE="${TITLE} - OK" + fi + if [ -n "${STATUS}" -o "$SEND_MAIL_ON_NO_ERROR" = "yes" ] ; then + send_email "$TITLE" "$CONTROL_MAIL" "$JOB_OUTPUT" + elif [ -s ${JOB_OUTPUT} -a "$SEND_OUTPUT_ON_NO_ERROR" = "yes" ] ; then + send_email "$TITLE" "$CONTROL_MAIL" "$JOB_OUTPUT" + fi + + rm -f ${CONTROL_MAIL} ${JOB_OUTPUT} + fi + done +fi + +# +# now make sure, we have no lastrun files dated to future +# +touch $SPOOL +NOW=`date -u +%s` +for i in `find $SPOOL -type f` +do + FILEDATE=`date -u -r $i +%s` + # allow for up to one hour in the future because of summer/wintertime + if [ $((FILEDATE - NOW)) -gt 3600 ] + then + rm $i + fi +done + + diff --git a/sample.root b/sample.root new file mode 100644 index 0000000..6d0dc4f --- /dev/null +++ b/sample.root @@ -0,0 +1,19 @@ +SHELL=/bin/sh +PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin +MAILTO=root +# +# check scripts in cron.hourly, cron.daily, cron.weekly, and cron.monthly + +# Example of job definition: +# .---------------- minute (0 - 59) +# | .------------- hour (0 - 23) +# | | .---------- day of month (1 - 31) +# | | | .------- month (1 - 12) OR jan,feb,mar,apr ... +# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat +# | | | | | +# * * * * * user-name command to be executed +@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 + diff --git a/sysconfig.cron b/sysconfig.cron new file mode 100644 index 0000000..8fdefbf --- /dev/null +++ b/sysconfig.cron @@ -0,0 +1,92 @@ +## The Parameters MAX_DAYS_IN_TMP, MAX_DAYS_IN_LONG_TMP, TMP_DIRS_TO_CLEAR, +## LONG_TMP_DIRS_TO_CLEAR, CLEAR_TMP_DIRS_AT_BOOTUP and OWNER_TO_KEEP_IN_TMP have +## been converted to systemd-tmpfiles settings in /etc/tmpfiles.d/tmp.conf. +## Please check and modify to your needs. +## See 'man tmpfiles.d' for details. + + +## Type: string +## Default: "" +# +# At which time cron.daily should start. Default is 15 minutes after booting +# the system. Example setting would be "14:00". +# Due to the fact that cron script runs only every 15 minutes, +# it will only run on xx:00, xx:15, xx:30, xx:45, not at the accurate time +# you set. +DAILY_TIME="" + +## Type: integer +## Default: 5 +# +# Maximum days not running when using a fixed time set in DAILY_TIME. +# 0 to skip this. This is for users who will power off their system. +# +# There is a fixed max. of 14 days set, if you want to override this +# change MAX_NOT_RUN_FORCE in /usr/libexec/cron/run-crons +MAX_NOT_RUN="5" + +## Type: yesno +## Default: no +# +# send status email even if all scripts in +# cron.{hourly,daily,weekly,monthly} +# returned without error? (yes/no) +# +SEND_MAIL_ON_NO_ERROR="no" + +## Type: yesno +## Default: no +# +# send email containing output from all successful jobs in +# cron.{hourly,daily,weekly,monthly}. Output from failed +# jobs is always sent. If SEND_MAIL_ON_NO_ERROR is yes, this +# setting is ignored. (yes/no) +# +SEND_OUTPUT_ON_NO_ERROR="no" + +## Type: yesno +## Default: no +# +# generate syslog message for all scripts in +# cron.{hourly,daily,weekly,monthly} +# even if they haven't returned an error? (yes/no) +# +SYSLOG_ON_NO_ERROR="no" +## Path: System/Cron/Man +## Description: cron configuration for man utility +## Type: yesno +## Default: yes +# +# Should mandb and whatis be recreated by cron.daily ("yes" or "no") +# +REINIT_MANDB=yes + +## Type: yesno +## Default: yes +# +# Should old preformatted man pages (in /var/cache/man) be deleted? (yes/no) +# +DELETE_OLD_CATMAN=yes + +## Type: integer +## Default: 7 +# +# How long should old preformatted man pages be kept before deletion? (days) +# +CATMAN_ATIME=7 + +## Type: yesno +## Default: yes +# +# Force cron.{hourly,daily,weekly,monthly} to be +# owned by user and group root +# +ENFORCE_ROOT_OWNER_GROUP_DIR="yes" + +## Type: integer +## Default: 755 +# +# Force cron.{hourly,daily,weekly,monthly} to have +# at most the listed permissions +# +SECURE_DIR_PERMISSIONS="755"