Bug#866041: anacron: may execute daily/weekly/monthly jobs shortly after midnight

2017-10-28 Thread Francesco Poli
On Tue, 10 Oct 2017 00:33:37 +0200 Francesco Poli wrote:

> On Sun, 1 Oct 2017 11:59:50 +0200 Francesco Poli wrote:
> 
> > On Sun, 27 Aug 2017 11:37:45 +0200 Francesco Poli wrote:
> > 
> > > On Fri, 30 Jun 2017 19:52:10 +0200 Francesco Poli wrote:
> > > 
> > > > On Thu, 29 Jun 2017 00:16:52 +0200 Michael Biebl wrote:
> > > [...]
> > > > > Afaics, this would basically reopen #744753.
> > > > > Take a laptop for example, which is charged over night and then booted
> > > > > in the morning while unplugged. We'd never trigger anacron because of
> > > > > ConditionACPower=true in anacron.service
> > > > > By triggering anacron.service hourly it's much more likely we hit a 
> > > > > time
> > > > > window where the system is plugged in.
> > > > 
> > > > Fair enough.
> > > > 
> > > > What about the attached patch?
> > > > 
> > > > It would at least exclude the time interval between midnight and early
> > > > morning, while retaining the hourly-repeated-attempts behavior from
> > > > 07:30 to 23:30.
> > > 
> > > Hello again,
> > > have you had time to think about my second patch?
> > > Do you consider it acceptable?
> > > 
> > > I hope you may incorporate it soon.
> > > Thanks for your time!
> > > 
> > > Bye.
> > 
> > Ping?
> 
> Second ping?

Third ping?


-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
. Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE


pgpDaR8yx_RBY.pgp
Description: PGP signature


Bug#866041: anacron: may execute daily/weekly/monthly jobs shortly after midnight

2017-10-09 Thread Francesco Poli
On Sun, 1 Oct 2017 11:59:50 +0200 Francesco Poli wrote:

> On Sun, 27 Aug 2017 11:37:45 +0200 Francesco Poli wrote:
> 
> > On Fri, 30 Jun 2017 19:52:10 +0200 Francesco Poli wrote:
> > 
> > > On Thu, 29 Jun 2017 00:16:52 +0200 Michael Biebl wrote:
> > [...]
> > > > Afaics, this would basically reopen #744753.
> > > > Take a laptop for example, which is charged over night and then booted
> > > > in the morning while unplugged. We'd never trigger anacron because of
> > > > ConditionACPower=true in anacron.service
> > > > By triggering anacron.service hourly it's much more likely we hit a time
> > > > window where the system is plugged in.
> > > 
> > > Fair enough.
> > > 
> > > What about the attached patch?
> > > 
> > > It would at least exclude the time interval between midnight and early
> > > morning, while retaining the hourly-repeated-attempts behavior from
> > > 07:30 to 23:30.
> > 
> > Hello again,
> > have you had time to think about my second patch?
> > Do you consider it acceptable?
> > 
> > I hope you may incorporate it soon.
> > Thanks for your time!
> > 
> > Bye.
> 
> Ping?

Second ping?


-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
. Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE


pgpUNjm3yL1L9.pgp
Description: PGP signature


Bug#866041: anacron: may execute daily/weekly/monthly jobs shortly after midnight

2017-10-01 Thread Francesco Poli
On Sun, 27 Aug 2017 11:37:45 +0200 Francesco Poli wrote:

> On Fri, 30 Jun 2017 19:52:10 +0200 Francesco Poli wrote:
> 
> > On Thu, 29 Jun 2017 00:16:52 +0200 Michael Biebl wrote:
> [...]
> > > Afaics, this would basically reopen #744753.
> > > Take a laptop for example, which is charged over night and then booted
> > > in the morning while unplugged. We'd never trigger anacron because of
> > > ConditionACPower=true in anacron.service
> > > By triggering anacron.service hourly it's much more likely we hit a time
> > > window where the system is plugged in.
> > 
> > Fair enough.
> > 
> > What about the attached patch?
> > 
> > It would at least exclude the time interval between midnight and early
> > morning, while retaining the hourly-repeated-attempts behavior from
> > 07:30 to 23:30.
> 
> Hello again,
> have you had time to think about my second patch?
> Do you consider it acceptable?
> 
> I hope you may incorporate it soon.
> Thanks for your time!
> 
> Bye.

Ping?


-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
. Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE


pgpPiWbGTByuB.pgp
Description: PGP signature


Bug#866041: anacron: may execute daily/weekly/monthly jobs shortly after midnight

2017-08-27 Thread Francesco Poli
On Fri, 30 Jun 2017 19:52:10 +0200 Francesco Poli wrote:

> On Thu, 29 Jun 2017 00:16:52 +0200 Michael Biebl wrote:
[...]
> > Afaics, this would basically reopen #744753.
> > Take a laptop for example, which is charged over night and then booted
> > in the morning while unplugged. We'd never trigger anacron because of
> > ConditionACPower=true in anacron.service
> > By triggering anacron.service hourly it's much more likely we hit a time
> > window where the system is plugged in.
> 
> Fair enough.
> 
> What about the attached patch?
> 
> It would at least exclude the time interval between midnight and early
> morning, while retaining the hourly-repeated-attempts behavior from
> 07:30 to 23:30.

Hello again,
have you had time to think about my second patch?
Do you consider it acceptable?

I hope you may incorporate it soon.
Thanks for your time!

Bye.

-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
. Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE


pgp7GMkC2LytG.pgp
Description: PGP signature


Bug#866041: anacron: may execute daily/weekly/monthly jobs shortly after midnight

2017-07-01 Thread Marc Haber
I have done a bit of research about anacron usage in Debian. I
downloaded and unpacked all packages that depend/recommend/suggest
anacron, and have looked at what kind of use they make of anacron.

The result is that there are _no_ packages that actually make use of
anacron's special features. The only thing that Debian actually
automatically does with anacron is execution of
cron.daily/weekly/monthly. All other usage of anacron is manual
intervention of the local admin anyway.

Considering that most advanced time controlled processes in Debian in
the future are likely to be implemented as systemd timer units, I think
that we're pretty safe her in assuming that the vast majority of anacron
installations will only invoke cron.daily/weekly/monthly. This also
means that if a local admin wants to have things differently, she is
pretty free to change the configuration without effect on other things
than cron.daily/weekly/monthly.

Greetings
Marc


-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany|  lose things."Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421



Bug#866041: anacron: may execute daily/weekly/monthly jobs shortly after midnight

2017-06-30 Thread Francesco Poli
On Thu, 29 Jun 2017 00:16:52 +0200 Michael Biebl wrote:

> On Mon, 26 Jun 2017 23:50:51 +0200 "Francesco Poli (wintermute)"
>  wrote:
[...]
> > This is inconsistent with the old behavior and with the behavior
> > of boxes with non-systemd init systems (where the check is performed
> > at boot or daily at 7:30, if the box is up and running at that time
> > of the day).
> 
> 
> > With the attached patch, the behavior becomes consistent with
> > the non-systemd one. Thanks to the Persistent=true directive,
> > any skipped checks will be catched up on boot or on resume,
> > but the check won't be performed between midnight and 7:30,
> > unless the box is booted/resumed in that time interval.
> 
> Afaics, this would basically reopen #744753.
> Take a laptop for example, which is charged over night and then booted
> in the morning while unplugged. We'd never trigger anacron because of
> ConditionACPower=true in anacron.service
> By triggering anacron.service hourly it's much more likely we hit a time
> window where the system is plugged in.

Fair enough.

What about the attached patch?

It would at least exclude the time interval between midnight and early
morning, while retaining the hourly-repeated-attempts behavior from
07:30 to 23:30.

 


-- 
 http://www.inventati.org/frx/
 There's not a second to spare! To the laboratory!
. Francesco Poli .
 GnuPG key fpr == CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE
diff -ruN a/anacron.timer b/anacron.timer
--- a/anacron.timer	2017-05-29 18:36:12.0 +0200
+++ b/anacron.timer	2017-06-30 00:49:59.054309949 +0200
@@ -2,7 +2,7 @@
 Description=Trigger anacron every hour
 
 [Timer]
-OnCalendar=hourly
+OnCalendar=*-*-* 07..23:30
 RandomizedDelaySec=5m
 Persistent=true
 


pgpUYWvwpbpTi.pgp
Description: PGP signature


Bug#866041: anacron: may execute daily/weekly/monthly jobs shortly after midnight

2017-06-28 Thread Michael Biebl
Am 29.06.2017 um 00:16 schrieb Michael Biebl:
> On Mon, 26 Jun 2017 23:50:51 +0200 "Francesco Poli (wintermute)"
>  wrote:
>> Package: anacron
>> Version: 2.3-24
>> Severity: normal
>> Tags: patch
>>
>> Hello,
>> I see that bug #744753 has been solved by changing the frequency at
>> which anacron checks whether there are jobs to be executed.
>> When systemd is PID 1, anacron performs this check hourly via
>> timer, rather than daily at 7:30, as done on boxes where systemd is
>> *not* PID 1 (/etc/cron.d/anacron).
>>
>> This behavior change has a significant side effect: if the box
>> is up and running at midnight, anacron may begin to execute
>> daily (and possibly also weekly or monthly) jobs shortly after.
>> Maybe it will (attempt to) start a backup or something like that,
>> after midnight, when it could be time to shut the box down...
> 
> If you run a backup via cron you should guard it against accidental
> shutdown in any case. systemd-inhibit is the tool you might want to look
> into.

I also want to add that in older releases anacron was triggered on
resume and AC changes (via the pm-utils hooks).

So you didn't necessarly have a fixed time when anacron (and possibly
such a backup script) runs.


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#866041: anacron: may execute daily/weekly/monthly jobs shortly after midnight

2017-06-28 Thread Michael Biebl
On Mon, 26 Jun 2017 23:50:51 +0200 "Francesco Poli (wintermute)"
 wrote:
> Package: anacron
> Version: 2.3-24
> Severity: normal
> Tags: patch
> 
> Hello,
> I see that bug #744753 has been solved by changing the frequency at
> which anacron checks whether there are jobs to be executed.
> When systemd is PID 1, anacron performs this check hourly via
> timer, rather than daily at 7:30, as done on boxes where systemd is
> *not* PID 1 (/etc/cron.d/anacron).
> 
> This behavior change has a significant side effect: if the box
> is up and running at midnight, anacron may begin to execute
> daily (and possibly also weekly or monthly) jobs shortly after.
> Maybe it will (attempt to) start a backup or something like that,
> after midnight, when it could be time to shut the box down...

If you run a backup via cron you should guard it against accidental
shutdown in any case. systemd-inhibit is the tool you might want to look
into.

> This is inconsistent with the old behavior and with the behavior
> of boxes with non-systemd init systems (where the check is performed
> at boot or daily at 7:30, if the box is up and running at that time
> of the day).


> With the attached patch, the behavior becomes consistent with
> the non-systemd one. Thanks to the Persistent=true directive,
> any skipped checks will be catched up on boot or on resume,
> but the check won't be performed between midnight and 7:30,
> unless the box is booted/resumed in that time interval.

Afaics, this would basically reopen #744753.
Take a laptop for example, which is charged over night and then booted
in the morning while unplugged. We'd never trigger anacron because of
ConditionACPower=true in anacron.service
By triggering anacron.service hourly it's much more likely we hit a time
window where the system is plugged in.

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Bug#866041: anacron: may execute daily/weekly/monthly jobs shortly after midnight

2017-06-28 Thread Marc Haber
On Mon, Jun 26, 2017 at 11:50:51PM +0200, Francesco Poli (wintermute) wrote:
> With the attached patch, the behavior becomes consistent with
> the non-systemd one. Thanks to the Persistent=true directive,
> any skipped checks will be catched up on boot or on resume,
> but the check won't be performed between midnight and 7:30,
> unless the box is booted/resumed in that time interval.

Agreed. This is a big surprise and a huge behavioral change, introduced
less than a month before the stretch release.  Please return to the old
behavior ASAP in the next point release.

Greetings
Marc

-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany|  lose things."Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421



Bug#866041: anacron: may execute daily/weekly/monthly jobs shortly after midnight

2017-06-26 Thread Francesco Poli (wintermute)
Package: anacron
Version: 2.3-24
Severity: normal
Tags: patch

Hello,
I see that bug #744753 has been solved by changing the frequency at
which anacron checks whether there are jobs to be executed.
When systemd is PID 1, anacron performs this check hourly via
timer, rather than daily at 7:30, as done on boxes where systemd is
*not* PID 1 (/etc/cron.d/anacron).

This behavior change has a significant side effect: if the box
is up and running at midnight, anacron may begin to execute
daily (and possibly also weekly or monthly) jobs shortly after.
Maybe it will (attempt to) start a backup or something like that,
after midnight, when it could be time to shut the box down...

This is inconsistent with the old behavior and with the behavior
of boxes with non-systemd init systems (where the check is performed
at boot or daily at 7:30, if the box is up and running at that time
of the day).

With the attached patch, the behavior becomes consistent with
the non-systemd one. Thanks to the Persistent=true directive,
any skipped checks will be catched up on boot or on resume,
but the check won't be performed between midnight and 7:30,
unless the box is booted/resumed in that time interval.

I hope this patch may be accepted.

Thanks for your time!
Bye.


-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (800, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages anacron depends on:
ii  debianutils  4.8.1.1
ii  init-system-helpers  1.48
ii  libc62.24-12
ii  lsb-base 9.20161125

Versions of packages anacron recommends:
ii  cron [cron-daemon]   3.0pl1-128+b1
ii  rsyslog [system-log-daemon]  8.27.0-3

Versions of packages anacron suggests:
ii  exim4-daemon-light [mail-transport-agent]  4.89-3
pn  powermgmt-base 

-- no debconf information
diff -ruN a/debian/anacron.timer b/debian/anacron.timer
--- a/debian/anacron.timer  2017-05-29 18:36:12.0 +0200
+++ b/debian/anacron.timer  2017-06-25 11:19:55.071811795 +0200
@@ -2,7 +2,7 @@
 Description=Trigger anacron every hour
 
 [Timer]
-OnCalendar=hourly
+OnCalendar=*-*-* 07:30
 RandomizedDelaySec=5m
 Persistent=true