Accepting request 314437 from Base:System
1 OBS-URL: https://build.opensuse.org/request/show/314437 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cronie?expand=0&rev=59
This commit is contained in:
commit
c582c1d20c
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:0f5c9bf32f352599451c4ca0d6bc076d19e73ecfa5a90b34ecfe47c918c8bafd
|
|
||||||
size 234214
|
|
3
cronie-1.5.0.tar.gz
Normal file
3
cronie-1.5.0.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:9cf0e3f4f5042a9c09413d62c8e0c055e12401f70b112465f0f81f2c84ebfb3f
|
||||||
|
size 242072
|
@ -1,3 +1,42 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
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
|
Thu Jun 4 00:51:52 UTC 2015 - crrodriguez@opensuse.org
|
||||||
|
|
||||||
|
50
cronie.spec
50
cronie.spec
@ -16,10 +16,9 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# 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
|
%define cron_configs %{_sysconfdir}/pam.d/crond %{_sysconfdir}/crontab %{_sysconfdir}/cron.deny %{_sysconfdir}/omc/srvinfo.d/cron.xml
|
||||||
Name: cronie
|
Name: cronie
|
||||||
Version: 1.4.12
|
Version: 1.5.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Cron Daemon
|
Summary: Cron Daemon
|
||||||
License: BSD-3-Clause and GPL-2.0 and MIT
|
License: BSD-3-Clause and GPL-2.0 and MIT
|
||||||
@ -49,24 +48,22 @@ Patch8: cronie-anacron-1.4.7-run-crons.patch
|
|||||||
Patch10: cronie-nofork-nopid.patch
|
Patch10: cronie-nofork-nopid.patch
|
||||||
Patch12: cronie-piddir.patch
|
Patch12: cronie-piddir.patch
|
||||||
# PATCH-FIX-SUSE the first occurance of "/etc/anacrontab" was replaced by "/etc/crontab"
|
# 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
|
Patch13: fix-manpage-replace-anacrontab-with-crontab.patch
|
||||||
BuildRequires: audit-devel
|
BuildRequires: audit-devel
|
||||||
BuildRequires: libselinux-devel
|
BuildRequires: libselinux-devel
|
||||||
BuildRequires: pam-devel
|
BuildRequires: pam-devel
|
||||||
BuildRequires: pkgconfig(systemd)
|
BuildRequires: pkgconfig(systemd)
|
||||||
Requires(pre): cron
|
|
||||||
Requires(post): permissions
|
|
||||||
Requires(post): %fillup_prereq
|
Requires(post): %fillup_prereq
|
||||||
|
Requires(post): permissions
|
||||||
|
Requires(pre): cron
|
||||||
Recommends: smtp_daemon
|
Recommends: smtp_daemon
|
||||||
Suggests: postfix
|
Suggests: postfix
|
||||||
# When finish update protection of sles11 we could uncomment line bellow and drop all
|
Conflicts: cron <= 4.1
|
||||||
# ugly hacks with subpackage cron needed for proper update proces
|
|
||||||
# Obsoletes: cron <=4.x
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
%{?systemd_requires}
|
%{?systemd_requires}
|
||||||
|
# This is needed as cron subpkg has its own version
|
||||||
%{expand: %%define cronie_version %{version}}
|
%{expand: %%define cronie_version %{version}}
|
||||||
Conflicts: cron <= 4.1
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
cron automatically starts programs at specific times. Add new entries
|
cron automatically starts programs at specific times. Add new entries
|
||||||
@ -150,34 +147,32 @@ install -v -d %{buildroot}%{_sysconfdir}/omc/srvinfo.d/
|
|||||||
install -v -m644 %{SOURCE5} %{buildroot}%{_sysconfdir}/omc/srvinfo.d/
|
install -v -m644 %{SOURCE5} %{buildroot}%{_sysconfdir}/omc/srvinfo.d/
|
||||||
|
|
||||||
%pre -n cron
|
%pre -n cron
|
||||||
# check if we are doing "ugly" update from old 4.1 vixie-cron
|
# Check if we are doing update from 4.1 vixie-cron.
|
||||||
check_cron_mail_feature=`%{_sbindir}/cron --help 2>&1 | %{_bindir}/grep mail`
|
# The -h does report garbage on vixie cron.
|
||||||
# vixie-cron 4.1 doesn't contain mail fature
|
check_cron_mail_feature=`%{_sbindir}/cron -h 2>&1 | %{_bindir}/grep mail`
|
||||||
if [ -e %{_sbindir}/cron -a -z "${check_cron_mail_feature}" ]; then
|
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
|
touch %{_localstatedir}/run/update_from_old_cron
|
||||||
echo $1
|
for conf in %{cron_configs} ; do
|
||||||
for conf in %{cron_configs}
|
cp "$conf" "$conf.rpmbk"
|
||||||
do
|
|
||||||
mv "$conf" "$conf.bk" ||:
|
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
exit 0
|
||||||
|
|
||||||
%pre
|
%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
|
%service_add_pre cron.service
|
||||||
|
|
||||||
%post
|
%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
|
%set_permissions %{_sysconfdir}/crontab %{_bindir}/crontab
|
||||||
%{fillup_only -n cron}
|
%{fillup_only -n cron}
|
||||||
%service_add_post cron.service
|
%service_add_post cron.service
|
||||||
|
exit 0
|
||||||
|
|
||||||
%verifyscript
|
%verifyscript
|
||||||
%verify_permissions -e %{_sysconfdir}/crontab -e %{_bindir}/crontab
|
%verify_permissions -e %{_sysconfdir}/crontab -e %{_bindir}/crontab
|
||||||
@ -188,11 +183,6 @@ fi
|
|||||||
%postun
|
%postun
|
||||||
%service_del_postun cron.service
|
%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
|
%post anacron
|
||||||
[ -e %{_localstatedir}/spool/anacron/cron.daily ] || touch %{_localstatedir}/spool/anacron/cron.daily
|
[ -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.weekly ] || touch %{_localstatedir}/spool/anacron/cron.weekly
|
||||||
|
38
run-crons
38
run-crons
@ -30,6 +30,8 @@
|
|||||||
# respect MAILTO as cron does
|
# respect MAILTO as cron does
|
||||||
# use mktemp -d for all tmpfiles
|
# use mktemp -d for all tmpfiles
|
||||||
# add variable to disable mail if all jobs returned 0
|
# 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
|
SPOOL=/var/spool/cron/lastrun
|
||||||
|
|
||||||
# CRON Result EMail is sent to
|
# CRON Result EMail is sent to
|
||||||
if test -z "$MAILTO" ; then
|
if [ -z "$MAILTO" ]; then
|
||||||
SEND_TO="root"
|
SEND_TO="root"
|
||||||
else
|
else
|
||||||
SEND_TO="$MAILTO"
|
SEND_TO="$MAILTO"
|
||||||
fi
|
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
|
mkdir -p $SPOOL
|
||||||
|
|
||||||
#set verbose
|
#set verbose
|
||||||
@ -232,9 +264,9 @@ if [ ! -z "${RUN}" ] ; then
|
|||||||
TITLE="${TITLE} - OK"
|
TITLE="${TITLE} - OK"
|
||||||
fi
|
fi
|
||||||
if [ -n "${STATUS}" -o "$SEND_MAIL_ON_NO_ERROR" = "yes" ] ; then
|
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
|
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
|
fi
|
||||||
|
|
||||||
rm -f ${CONTROL_MAIL} ${JOB_OUTPUT}
|
rm -f ${CONTROL_MAIL} ${JOB_OUTPUT}
|
||||||
|
Loading…
Reference in New Issue
Block a user