commit cronie.3867 for openSUSE:13.2:Update
Hello community, here is the log from the commit of package cronie.3867 for openSUSE:13.2:Update checked in at 2015-07-02 09:35:49 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:13.2:Update/cronie.3867 (Old) and /work/SRC/openSUSE:13.2:Update/.cronie.3867.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "cronie.3867" Changes: -------- New Changes file: --- /dev/null 2015-06-25 09:04:34.320025005 +0200 +++ /work/SRC/openSUSE:13.2:Update/.cronie.3867.new/cronie.changes 2015-07-02 09:35:50.000000000 +0200 @@ -0,0 +1,1146 @@ +------------------------------------------------------------------- +Tue Jun 23 08:33:33 UTC 2015 - tchvatal@suse.com + +- Sync cron.service with Factory, fixing bnc#926961. + +------------------------------------------------------------------- +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 ++++ 949 more lines (skipped) ++++ between /dev/null ++++ and /work/SRC/openSUSE:13.2:Update/.cronie.3867.new/cronie.changes New: ---- cron.service cron.xml cron_to_cronie.README cronie-1.4.12.tar.gz cronie-1.4.7-disable_logging.patch cronie-anacron-1.4.7-run-crons.patch cronie-crond_pid.diff cronie-nheader_lines.diff cronie-nofork-nopid.patch cronie-pam_config.diff cronie-piddir.patch cronie-rpmlintrc cronie.changes cronie.spec deny.sample fix-manpage-replace-anacrontab-with-crontab.patch run-crons sample.root sysconfig.cron ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cronie.spec ++++++ # # spec file for package cronie # # Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # 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 http://bugs.opensuse.org/ # # 3 : we don't need to do something with /etc/sysconfig/cron for now %define cron_configs \{%{_sysconfdir}/pam.d/crond,%{_sysconfdir}/crontab,%{_sysconfdir}/cron.deny,%{_sysconfdir}/omc/srvinfo.d/cron.xml\} Name: cronie Version: 1.4.12 Release: 0 Summary: Cron Daemon License: BSD-3-Clause and GPL-2.0 and MIT Group: System/Daemons Url: https://fedorahosted.org/cronie/ Source0: https://fedorahosted.org/releases/c/r/%{name}/%{name}-%{version}.tar.gz Source2: run-crons Source3: sample.root Source4: deny.sample Source5: cron.xml Source6: cronie-rpmlintrc 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: %{name}-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: %{name}-nheader_lines.diff # we use cron.pid instead of crond.pid Patch5: %{name}-crond_pid.diff # PATCH-FIX-UPSTREAM mention logging disabling for a command in man Patch7: cronie-1.4.7-disable_logging.patch # PATCH-FIX-UPSTREAM use run-crons instead of run-parts for anacron (bnc#689494) Patch8: cronie-anacron-1.4.7-run-crons.patch Patch10: cronie-nofork-nopid.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. Patch13: fix-manpage-replace-anacrontab-with-crontab.patch BuildRequires: audit-devel BuildRequires: libselinux-devel BuildRequires: pam-devel BuildRequires: pkgconfig(systemd) Requires(pre): cron Requires(post): permissions Requires(post): %fillup_prereq Recommends: smtp_daemon Suggests: postfix # When finish update protection of sles11 we could uncomment line bellow and drop all # ugly hacks with subpackage cron needed for proper update proces # Obsoletes: cron <=4.x BuildRoot: %{_tmppath}/%{name}-%{version}-build %{?systemd_requires} %{expand: %%define cronie_version %{version}} Conflicts: cron <= 4.1 %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} %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 %patch3 -p1 %patch4 %patch5 -p1 %patch7 -p1 %patch8 -p1 cp %{SOURCE7} ./cron_to_cronie.README %patch10 %patch12 -p1 %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" %configure \ --with-audit \ --enable-anacron \ --with-pam \ --with-selinux \ --with-inotify \ --enable-pie \ SPOOL_DIR="%{_localstatedir}/spool/cron/tabs" make %{?_smp_mflags} %install make DESTDIR=%{buildroot} install %{?_smp_mflags} 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}%{_localstatedir}/adm/fillup-templates cp %{SOURCE9} %{buildroot}%{_localstatedir}/adm/fillup-templates/ touch %{buildroot}%{_localstatedir}/spool/anacron/cron.daily touch %{buildroot}%{_localstatedir}/spool/anacron/cron.weekly touch %{buildroot}%{_localstatedir}/spool/anacron/cron.monthly # service xml install -v -d %{buildroot}%{_sysconfdir}/omc/srvinfo.d/ install -v -m644 %{SOURCE5} %{buildroot}%{_sysconfdir}/omc/srvinfo.d/ %pre -n cron # check if we are doing "ugly" update from old 4.1 vixie-cron check_cron_mail_feature=`%{_sbindir}/cron --help 2>&1 | %{_bindir}/grep mail` # vixie-cron 4.1 doesn't contain mail fature if [ -e %{_sbindir}/cron -a "${check_cron_mail_feature}" == "" ]; then # save configs for cronie post-install phase touch %{_localstatedir}/run/update_from_old_cron echo $1 for conf in %{cron_configs} do mv "$conf" "$conf.bk" ||: done fi %pre if [ -e %{_localstatedir}/run/update_from_old_cron ]; then # restore configs for conf in %{cron_configs} do mv "$conf.bk" "$conf" ||: done fi %service_add_pre cron.service %post # when we are doing rename then we pretend update with set 2 %set_permissions %{_sysconfdir}/crontab %{_bindir}/crontab %{fillup_only -n cron} %service_add_post cron.service %verifyscript %verify_permissions -e %{_sysconfdir}/crontab -e %{_bindir}/crontab %preun %service_del_preun cron.service %postun %service_del_postun cron.service %posttrans if [ -e %{_localstatedir}/run/update_from_old_cron ]; then rm %{_localstatedir}/run/update_from_old_cron ||: fi %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 %files %defattr(-,root,root) %doc AUTHORS COPYING README ChangeLog %dir %attr(700,root,root) %{_localstatedir}/spool/cron %dir %attr(700,root,root) %{_localstatedir}/spool/cron/tabs %dir %{_localstatedir}/spool/cron/lastrun %config %{_sysconfdir}/pam.d/crond %verify(not mode) %config(noreplace) %{_sysconfdir}/crontab %config(noreplace) %{_sysconfdir}/cron.deny %{_mandir}/man1/crontab.1.gz %{_mandir}/man5/crontab.5.gz %{_mandir}/man8/cron.8.gz %{_mandir}/man8/crond.8.gz %verify(not mode) %attr (4750,root,trusted) %{_bindir}/crontab %attr (755,root,root) %{_sbindir}/cron %{_sbindir}/rccron %{_libexecdir}/cron %config %{_sysconfdir}/omc/srvinfo.d/cron.xml %dir %{_sysconfdir}/omc/srvinfo.d/ %dir %{_sysconfdir}/omc/ %{_unitdir}/cron.service %{_localstatedir}/adm/fillup-templates/sysconfig.cron %files anacron %defattr(-,root,root,-) %{_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.* %{_mandir}/man8/anacron.* %files -n cron %defattr(-,root,root,-) %doc cron_to_cronie.README %changelog ++++++ cron.service ++++++ [Unit] Description=Command Scheduler After=nss-user-lookup.target network.target time-sync.target After=postfix.service sendmail.service exim.service After=sssd.service [Service] ExecStart=/usr/sbin/cron -n ExecReload=/usr/bin/kill -s SIGHUP $MAINPID Restart=on-abort [Install] WantedBy=multi-user.target ++++++ cron_to_cronie.README ++++++ 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 ++++++ cronie-1.4.7-disable_logging.patch ++++++ Index: cronie-1.4.11/man/crontab.5 =================================================================== --- cronie-1.4.11.orig/man/crontab.5 +++ cronie-1.4.11/man/crontab.5 @@ -213,6 +213,9 @@ Names can also be used for the 'month' a first three letters of the particular day or month (case does not matter). Ranges or lists of names are not allowed. .PP +If the uid of the owner is 0 (root), he can put a "-" as first character of a crontab entry. +This will prevent cron from writing a syslog message about this command getting executed. +.PP The "sixth" field (the rest of the line) specifies the command to be run. The entire command portion of the line, up to a newline or a "%" character, will be executed by /bin/sh or by the shell specified in the Index: cronie-1.4.11/src/entry.c =================================================================== --- cronie-1.4.11.orig/src/entry.c +++ cronie-1.4.11/src/entry.c @@ -121,13 +121,18 @@ entry *load_entry(FILE * file, void (*er if (ch == '-') { /* if we are editing system crontab or user uid is 0 (root) * we are allowed to disable logging + * Otherwise log the attempt, but still execute the command. */ if (pw == NULL || pw->pw_uid == 0) e->flags |= DONT_LOG; else { - log_it("CRON", getpid(), "ERROR", "Only privileged user can disable logging", 0); - ecode = e_option; - goto eof; + log_it("CRON", getpid(), "ERROR", + "Only privileged user can disable logging. " + "In future versions, user lines starting with a dash " + "will be treated as invalid and won't get executed.", 0); + /* throw an error when editing a crontab */ + if (error_func) + (*error_func) (ecodes[(int) e_minute]); } ch = get_char(file); if (ch == EOF) @@ -401,9 +406,9 @@ entry *load_entry(FILE * file, void (*er Debug(DPARS, ("load_entry()...returning successfully\n")); - /* success, fini, return pointer to the entry we just created... - */ - return (e); + /* success, fini, return pointer to the entry we just created... + */ + return (e); eof: if (e->envp) ++++++ cronie-anacron-1.4.7-run-crons.patch ++++++ Index: cronie-1.4.7/contrib/anacrontab =================================================================== --- cronie-1.4.7.orig/contrib/anacrontab +++ cronie-1.4.7/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/lib/cron/run-crons /etc/cron.daily +7 25 cron.weekly nice /usr/lib/cron/run-crons /etc/cron.weekly +@monthly 45 cron.monthly nice /usr/lib/cron/run-crons /etc/cron.monthly Index: cronie-1.4.7/man/anacrontab.5 =================================================================== --- cronie-1.4.7.orig/man/anacrontab.5 +++ cronie-1.4.7/man/anacrontab.5 @@ -79,9 +79,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/lib/cron/run-crons /etc/cron.daily +7 0 cron.weekly nice /usr/lib/cron/run-crons /etc/cron.weekly +@monthly 0 cron.monthly nice /usr/lib/cron/run-crons /etc/cron.monthly .fi .SH "SEE ALSO" .BR anacron (8), ++++++ cronie-crond_pid.diff ++++++ 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 @@ #else # define PIDDIR SYSCONFDIR "/" #endif -#define PIDFILE "crond.pid" +#define PIDFILE "cron.pid" #define _PATH_CRON_PID PIDDIR PIDFILE #define REBOOT_LOCK PIDDIR "cron.reboot" ++++++ cronie-nheader_lines.diff ++++++ Index: src/crontab.c =================================================================== --- src/crontab.c.orig +++ src/crontab.c @@ -65,7 +65,7 @@ #include "pathnames.h" #include "structs.h" -#define NHEADER_LINES 0 +#define NHEADER_LINES 3 enum opt_t {opt_unknown, opt_list, opt_delete, opt_edit, opt_replace, opt_hostset, opt_hostget}; @@ -475,7 +475,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; @@ -527,13 +527,25 @@ 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) + + /* 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) while (EOF != (ch = get_char(f))) putc(ch, NewCrontab); @@ -741,6 +753,7 @@ static int replace_cmd(void) { int error = 0; entry *e; uid_t file_owner; + time_t now = time(NULL); char **envp; char *safename; @@ -770,10 +783,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); ++++++ cronie-nofork-nopid.patch ++++++ Index: src/misc.c =================================================================== --- src/misc.c.orig +++ src/misc.c @@ -311,6 +311,8 @@ void acquire_daemonlock(int closeflag) { return; } + if(NoFork == 1) return; //move along, nothing to do here.. + if (fd == -1) { pidfile = _PATH_CRON_PID; /* Initial mode is 0600 to prevent flock() race/DoS. */ ++++++ cronie-pam_config.diff ++++++ Index: cronie-1.4.8/pam/crond =================================================================== --- cronie-1.4.8.orig/pam/crond +++ cronie-1.4.8/pam/crond @@ -3,8 +3,10 @@ # # # No PAM authentication called, auth modules not needed -account required pam_access.so -account include password-auth -session required pam_loginuid.so -session include password-auth -auth include password-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 required pam_loginuid.so +session include common-session ++++++ cronie-piddir.patch ++++++ --- cronie-1.4.8.orig/src/pathnames.h +++ cronie-1.4.8/src/pathnames.h @@ -37,7 +37,7 @@ * (Don't ask why the default is "/etc/".) */ #ifdef _PATH_VARRUN -# define PIDDIR _PATH_VARRUN +# define PIDDIR "/run/" #else # define PIDDIR SYSCONFDIR "/" #endif ++++++ cronie-rpmlintrc ++++++ # This line is mandatory to access the configuration functions from Config import * addFilter("cronie.* incoherent-init-script-name")++++++ deny.sample ++++++ guest ++++++ fix-manpage-replace-anacrontab-with-crontab.patch ++++++
From 8769bba06b1632c6bd275f88c0fd10f591efdb9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=BDna=20Streitov=C3=A1?= <kstreitova@suse.cz> 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 ++++++ run-crons ++++++ #!/bin/bash # # /usr/lib/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 <bs@suse.de>, 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 # # # Don't run jobs on laptops, that are AC-offline # if test -x /usr/bin/on_ac_power ; then on_ac_power -q if [ "$?" = "1" ]; then exit 0 fi fi 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 test -z "$MAILTO" ; then SEND_TO="root" else SEND_TO="$MAILTO" fi mkdir -p $SPOOL #set verbose ## stage 1, search directories/scripts to run RUN="" for CRONDIR in /etc/cron.{hourly,daily,weekly,monthly} ; do test -d $CRONDIR || continue 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 /sbin/checkproc $SCRIPT && continue 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 cat ${CONTROL_MAIL} ${JOB_OUTPUT} | mail ${SEND_TO} -s "${TITLE}" elif [ -s ${JOB_OUTPUT} -a "$SEND_OUTPUT_ON_NO_ERROR" = "yes" ] ; then cat ${CONTROL_MAIL} ${JOB_OUTPUT} | mail ${SEND_TO} -s "${TITLE}" 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 ++++++ sample.root ++++++ 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 # -*/15 * * * * root test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1 ++++++ sysconfig.cron ++++++ ## 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/lib/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
participants (1)
-
root@hilbert.suse.de