cronie/test-for-etc-default-anacron.patch
Danilo Spinella 08b459752f Accepting request 1138166 from home:dspinella:branches:Base:System
- Fix anacron not working when /etc/default/anacron does not exist,
  fixes bsc#1218377
  * test-for-etc-default-anacron.patch

OBS-URL: https://build.opensuse.org/request/show/1138166
OBS-URL: https://build.opensuse.org/package/show/Base:System/cronie?expand=0&rev=215
2024-01-11 17:56:06 +00:00

27 lines
812 B
Diff

From 7700b1465d32ddb1d3988e9af852af6f0f5cd66e Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
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