Hi,

please don't mix up the these two etckeeper bugs:
#883263: Please don't start both cron job and systemd.timer
#884824: etckeeper: daily autocommit is run even though 
AVOID_DAILY_AUTOCOMMITS=1

They may exhibit the same symptoms in a specific configuration, but they are 
seperate issues. Luca Capello's patch would only address #884828, but not 
#883263. And on top of that, it actually needs a modification or it would cause 
a regression. The condition [ ${AVOID_DAILY_AUTOCOMMITS} -eq 0 ] will result in 
a shell error if the variable AVOID_DAILY_AUTOCOMMITS is unset (e.g. if 
commented out in the configuration file). So, the = operator would be a better 
choice here with the variable in quotes.

The reason why this approach would not resolve bux #883263 is that you may want 
to run the daily auto commits, but not twice via etckepper.timer and 
cron.daily/etckeeper. I came across this issue because on one of my systems the 
cron.daily/etckeeper script actually failed with the following error:
fatal: cannot lock ref 'HEAD': is at 8ea7b71b7927e16c747ea70c9287aa929fdeaa06 
but expected 5ca95a9cd452650cbf62ee40b6697097a8aa386b
run-parts: /etc/cron.daily/etckeeper exited with return code 128

It took me a while to figure out the reason for this error: It was because, 
coincidentally, the etckeeper.timer was sheduled to run at the same time as 
cron.daily. So, the etckeeper/daily script was executed twice at the same time 
which caused one of the two processes to fail.

So, in order to avoid the etckeeper.timer and cron.daily/etckeeper to execute 
both a different solution would be required.

I will send out seperate emails to both bugs with patches addressing the issues 
mentioned.

Thanks,

Timo

Reply via email to