diff --git a/cronie.changes b/cronie.changes index 505c396..04c3d4a 100644 --- a/cronie.changes +++ b/cronie.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jan 11 17:52:56 UTC 2024 - Danilo Spinella + +- Fix anacron not working when /etc/default/anacron does not exist, + fixes bsc#1218377 + * test-for-etc-default-anacron.patch + ------------------------------------------------------------------- Sat Nov 11 15:17:43 UTC 2023 - Andrea Manzini diff --git a/cronie.spec b/cronie.spec index 026d3de..5ae531a 100644 --- a/cronie.spec +++ b/cronie.spec @@ -1,7 +1,7 @@ # # spec file for package cronie # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -48,6 +48,8 @@ Patch5: cronie-crond_pid.diff Patch13: fix-manpage-replace-anacrontab-with-crontab.patch # PATCH-FEATURE-OPENSUSE user common-session-nonlogin Patch14: cronie-pam_config-nonlogin.diff +# PATCH-FIX-UPSTREAM danilo.spinella@suse.com bsc#1218377 +Patch15: test-for-etc-default-anacron.patch BuildRequires: audit-devel BuildRequires: autoconf BuildRequires: automake @@ -109,6 +111,7 @@ cp %{SOURCE7} ./cron_to_cronie.README %if 0%{?suse_version} > 1500 %patch14 -p1 %endif +%patch15 -p1 %build # fill macro CRON_VERSION it is used in top three lines of crontab file,should be reworked diff --git a/test-for-etc-default-anacron.patch b/test-for-etc-default-anacron.patch new file mode 100644 index 0000000..7fc64ac --- /dev/null +++ b/test-for-etc-default-anacron.patch @@ -0,0 +1,26 @@ +From 7700b1465d32ddb1d3988e9af852af6f0f5cd66e Mon Sep 17 00:00:00 2001 +From: Christian Hesse +Date: Mon, 16 Oct 2023 10:14:33 +0200 +Subject: [PATCH] re-introduce the test for existence of file + +If the file does not exist it exits early with error... Let's source +only if files acutually does exist. We still have a sane default. +--- + contrib/0anacron | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/contrib/0anacron b/contrib/0anacron +index 090219a..5379e41 100644 +--- a/contrib/0anacron ++++ b/contrib/0anacron +@@ -8,7 +8,9 @@ if [ `date +%Y%m%d` = "$day" ]; then + fi + + # Check whether run on battery should be allowed +-. /etc/default/anacron ++if test -r /etc/default/anacron; then ++ . /etc/default/anacron ++fi + + if [ "$ANACRON_RUN_ON_BATTERY_POWER" != "yes" ]; then +