From abff32990a1b666e8fbc539bf94d81b5d13854abb4233c53d750dce66887d4d0 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sat, 20 Jun 2015 12:01:49 +0000 Subject: [PATCH 1/5] Accepting request 312749 from home:kstreitova:branches:Base:System - 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 OBS-URL: https://build.opensuse.org/request/show/312749 OBS-URL: https://build.opensuse.org/package/show/Base:System/cronie?expand=0&rev=141 --- cronie-1.4.12.tar.gz | 3 --- cronie-1.5.0.tar.gz | 3 +++ cronie.changes | 16 ++++++++++++++++ cronie.spec | 10 +++++----- 4 files changed, 24 insertions(+), 8 deletions(-) delete mode 100644 cronie-1.4.12.tar.gz create mode 100644 cronie-1.5.0.tar.gz diff --git a/cronie-1.4.12.tar.gz b/cronie-1.4.12.tar.gz deleted file mode 100644 index 77cde41..0000000 --- a/cronie-1.4.12.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0f5c9bf32f352599451c4ca0d6bc076d19e73ecfa5a90b34ecfe47c918c8bafd -size 234214 diff --git a/cronie-1.5.0.tar.gz b/cronie-1.5.0.tar.gz new file mode 100644 index 0000000..735ecf1 --- /dev/null +++ b/cronie-1.5.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9cf0e3f4f5042a9c09413d62c8e0c055e12401f70b112465f0f81f2c84ebfb3f +size 242072 diff --git a/cronie.changes b/cronie.changes index b246dac..430ec44 100644 --- a/cronie.changes +++ b/cronie.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +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 diff --git a/cronie.spec b/cronie.spec index c29362b..ef39bfd 100644 --- a/cronie.spec +++ b/cronie.spec @@ -19,7 +19,7 @@ # 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 +Version: 1.5.0 Release: 0 Summary: Cron Daemon License: BSD-3-Clause and GPL-2.0 and MIT @@ -49,24 +49,24 @@ 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. +# 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 +Requires(post): permissions +Requires(pre): cron Recommends: smtp_daemon Suggests: postfix +Conflicts: cron <= 4.1 # 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 From 93a4cef2d6fcb2ff0d9614ccad8810ba836ad0fa39b9008053d012bf7bf391a3 Mon Sep 17 00:00:00 2001 From: Kristyna Streitova Date: Mon, 22 Jun 2015 14:48:19 +0000 Subject: [PATCH 2/5] Accepting request 313104 from home:scarabeus_iv:branches:Base:System - Redo the post/pre update approach to fix migration from SLE11. Should fix bnc#919028 OBS-URL: https://build.opensuse.org/request/show/313104 OBS-URL: https://build.opensuse.org/package/show/Base:System/cronie?expand=0&rev=142 --- cronie.changes | 6 ++++++ cronie.spec | 39 ++++++++++++++------------------------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/cronie.changes b/cronie.changes index 430ec44..afb0a67 100644 --- a/cronie.changes +++ b/cronie.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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 diff --git a/cronie.spec b/cronie.spec index ef39bfd..e99a41e 100644 --- a/cronie.spec +++ b/cronie.spec @@ -16,7 +16,6 @@ # -# 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.5.0 @@ -61,9 +60,6 @@ Requires(pre): cron Recommends: smtp_daemon Suggests: postfix Conflicts: cron <= 4.1 -# 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}} @@ -150,34 +146,32 @@ 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 +# Check if we are doing update from 4.1 vixie-cron. +# The -h does report garbage on vixie cron. +check_cron_mail_feature=`%{_sbindir}/cron -h 2>&1 | %{_bindir}/grep mail` if [ -e %{_sbindir}/cron -a -z "${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" ||: + for conf in %{cron_configs} ; do + cp "$conf" "$conf.rpmbk" done fi +exit 0 %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 +# Move the old cron configurations back if we were updating +if [ -e %{_localstatedir}/run/update_from_old_cron ]; then + for conf in %{cron_configs} ; do + mv "$conf.rpmbk" "$conf" + done + rm %{_localstatedir}/run/update_from_old_cron +fi %set_permissions %{_sysconfdir}/crontab %{_bindir}/crontab %{fillup_only -n cron} %service_add_post cron.service +exit 0 %verifyscript %verify_permissions -e %{_sysconfdir}/crontab -e %{_bindir}/crontab @@ -188,11 +182,6 @@ fi %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 From c3a8cc4a0b1ceb0f7995103ad443dc0cac10333650bd687ae8cc6153a35e63ab Mon Sep 17 00:00:00 2001 From: Kristyna Streitova Date: Tue, 23 Jun 2015 12:23:26 +0000 Subject: [PATCH 3/5] Accepting request 313218 from home:scarabeus_iv:branches:Base:System - Start cron after sssd.service bnc#926961 OBS-URL: https://build.opensuse.org/request/show/313218 OBS-URL: https://build.opensuse.org/package/show/Base:System/cronie?expand=0&rev=143 --- cron.service | 1 + cronie.changes | 5 +++++ cronie.spec | 1 + 3 files changed, 7 insertions(+) diff --git a/cron.service b/cron.service index e195fbc..fb25f46 100644 --- a/cron.service +++ b/cron.service @@ -2,6 +2,7 @@ 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 diff --git a/cronie.changes b/cronie.changes index afb0a67..2c5179d 100644 --- a/cronie.changes +++ b/cronie.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +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 diff --git a/cronie.spec b/cronie.spec index e99a41e..4b681ce 100644 --- a/cronie.spec +++ b/cronie.spec @@ -62,6 +62,7 @@ Suggests: postfix Conflicts: cron <= 4.1 BuildRoot: %{_tmppath}/%{name}-%{version}-build %{?systemd_requires} +# This is needed as cron subpkg has its own version %{expand: %%define cronie_version %{version}} %description From 1510b6cfde78a2b821414a29d55841e6461b34c86199053807b579627cfc3e88 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 29 Jun 2015 21:30:54 +0000 Subject: [PATCH 4/5] Accepting request 313829 from home:matejcik:branches:Base:System - add support for MAILFROM, MAIL_CONFIG and different mailer binaries in run-crons (bnc#812367, bnc#366762) OBS-URL: https://build.opensuse.org/request/show/313829 OBS-URL: https://build.opensuse.org/package/show/Base:System/cronie?expand=0&rev=144 --- cronie.changes | 6 ++++++ run-crons | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/cronie.changes b/cronie.changes index 2c5179d..15f407e 100644 --- a/cronie.changes +++ b/cronie.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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 diff --git a/run-crons b/run-crons index bdd335c..c4180f7 100644 --- a/run-crons +++ b/run-crons @@ -30,6 +30,8 @@ # 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 # # @@ -65,12 +67,42 @@ CRON_SCRIPT_NICE_VALUE=15 SPOOL=/var/spool/cron/lastrun # CRON Result EMail is sent to -if test -z "$MAILTO" ; then +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 @@ -232,9 +264,9 @@ if [ ! -z "${RUN}" ] ; then 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}" + send_email "$TITLE" "$CONTROL_MAIL" "$JOB_OUTPUT" elif [ -s ${JOB_OUTPUT} -a "$SEND_OUTPUT_ON_NO_ERROR" = "yes" ] ; then - cat ${CONTROL_MAIL} ${JOB_OUTPUT} | mail ${SEND_TO} -s "${TITLE}" + send_email "$TITLE" "$CONTROL_MAIL" "$JOB_OUTPUT" fi rm -f ${CONTROL_MAIL} ${JOB_OUTPUT} From e5565fcee6f3c93209c42c8033c0ffc3943a7edc85c91b15fc9c18303ebb94a2 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 29 Jun 2015 21:31:10 +0000 Subject: [PATCH 5/5] Accepting request 313742 from home:elvigia:branches:Base:System - revert last change, it is a bug in sssd.service, fixed in SR#313709 OBS-URL: https://build.opensuse.org/request/show/313742 OBS-URL: https://build.opensuse.org/package/show/Base:System/cronie?expand=0&rev=145 --- cron.service | 1 - cronie.changes | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cron.service b/cron.service index fb25f46..e195fbc 100644 --- a/cron.service +++ b/cron.service @@ -2,7 +2,6 @@ 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 diff --git a/cronie.changes b/cronie.changes index 15f407e..e3be4b7 100644 --- a/cronie.changes +++ b/cronie.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +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