FS#79954 - [cronie] 1.7.0-2 missing file /etc/default/anacron leads to errors every hour

Attached to Project: Arch Linux
Opened by Gene (GeneC) - Saturday, 14 October 2023, 09:23 GMT
Last edited by Christian Hesse (eworm) - Monday, 16 October 2023, 08:57 GMT
Task Type Bug Report
Category Packages: Testing
Status Closed
Assigned To Christian Hesse (eworm)
Levente Polyak (anthraxx)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
After updating all systems report this error every hour

/etc/cron.hourly/0anacron: line 11: /etc/default/anacron: No such file or directory
run-parts: /etc/cron.hourly/0anacron exited with return code 1


Additional info:
The problem is that /etc/cron.hourly/0anacron now contains :
------------------ snip -------------------
# Check whether run on battery should be allowed
. /etc/default/anacron

if [ "$ANACRON_RUN_ON_BATTERY_POWER" != "yes" ]; then
...
--------------------------------------------

All we need is to add the missing file

/etc/default/anacron
defining the variable

ANACRON_RUN_ON_BATTERY_POWER='yes' # or 'no'


This task depends upon

Closed by  Christian Hesse (eworm)
Monday, 16 October 2023, 08:57 GMT
Reason for closing:  Fixed
Additional comments about closing:  cronie 1.7.0-3
Comment by Gene (GeneC) - Saturday, 14 October 2023, 09:49 GMT
Correction - the file only needs to exist - the variable doesn't need to be set to anything - though adding a comment
seems reasonable - maybe something like:

# /etc/default/anacron
# Set this to yes to have anacron run while on battery
# ANACRON_RUN_ON_BATTERY_POWER='yes'

- the other new variable NO_MAIL_OUTPUT is documented in anacrontab and nothing is needed in anacrontab for that since code (anacron/runjob.c) checks if it exists and has any value.


Comment by Gene (GeneC) - Saturday, 14 October 2023, 09:54 GMT
I need more coffee - obviously the default is to run on battery so the comment should be

# /etc/default/anacron
# Set this to no to have anacron not run while on battery
# By default it is run while on battery
# ANACRON_RUN_ON_BATTERY_POWER='no

Loading...