[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#859757: marked as done (apt.systemd.daily: support zero-delay and short-delay unattended-upgrades)



Your message dated Sat, 23 Dec 2017 13:23:44 +0800
with message-id <1514006624.2859.90.camel@debian.org>
and subject line Re: limit source to apt, tagging 859757
has caused the Debian Bug report #859757,
regarding apt.systemd.daily: support zero-delay and short-delay unattended-upgrades
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
859757: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859757
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: apt
Severity: wishlist
Version: 1.4
File: /usr/lib/apt/apt.systemd.daily
Tags: patch

Currently the shortest time period between apt.systemd.daily running
unattended-upgrades is one day. Debian testing is currently upgraded
twice per day so it would be nice to be able to set upgrades to happen
every 12h, but sometimes local or third-party repos can be updated on a
faster schedule so it would be nice to be able to always upgrade.
I've attached a sketch of how enabling those options might work, it
adds an 'always' option for each interval option and also accepts all
interval values with the time unit appended (only 1 unit allowed).

-- 
bye,
pabs

https://wiki.debian.org/PaulWise
From 1355ccd20a42c33c8349d3efb07b0f3879d43431 Mon Sep 17 00:00:00 2001
From: Paul Wise <pabs@debian.org>
Date: Fri, 7 Apr 2017 08:18:17 +0800
Subject: [PATCH 1/2] Support zero delay for the various APT::Periodic
 activities

---
 debian/apt.systemd.daily | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/debian/apt.systemd.daily b/debian/apt.systemd.daily
index 03d41bae5..5e9ee4a2d 100755
--- a/debian/apt.systemd.daily
+++ b/debian/apt.systemd.daily
@@ -90,6 +90,12 @@ check_stamp()
         return 0
     fi
 
+    if [ $interval = always ]; then
+	debug_echo "check_stamp: ignoring time stamp file, interval set to always"
+	# treat as enough time has passed
+        return 0
+    fi
+
     # compare midnight today to midnight the day the stamp was updated
     stamp_file="$stamp"
     stamp=$(date --date=$(date -r $stamp_file --iso-8601) +%s 2>/dev/null)
-- 
2.11.0

From 656cc1f631471cd78245b4d7600674b18c788521 Mon Sep 17 00:00:00 2001
From: Paul Wise <pabs@debian.org>
Date: Fri, 7 Apr 2017 08:19:59 +0800
Subject: [PATCH 2/2] Support seconds, minutes, hours and days for
 APT::Periodic intervals

---
 debian/apt.systemd.daily | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/debian/apt.systemd.daily b/debian/apt.systemd.daily
index 5e9ee4a2d..59fe4d8a5 100755
--- a/debian/apt.systemd.daily
+++ b/debian/apt.systemd.daily
@@ -118,8 +118,20 @@ check_stamp()
 
     delta=$(($now-$stamp))
 
-    # interval is in days, convert to sec.
-    interval=$(($interval*60*60*24))
+    # Calculate the interval in seconds depending on the unit specified
+    if [ "${interval%s}" != "$interval" ] ; then
+        interval="${interval%s}"
+    elif [ "${interval%m}" != "$interval" ] ; then
+        interval="${interval%m}"
+        interval=$((interval*60))
+    elif [ "${interval%h}" != "$interval" ] ; then
+        interval="${interval%h}"
+        interval=$((interval*60*60))
+    else
+        interval="${interval%d}"
+        interval=$((interval*60*60*24))
+    fi
+
     debug_echo "check_stamp: interval=$interval, now=$now, stamp=$stamp, delta=$delta (sec)"
 
     # remove timestamps a day (or more) in the future and force re-check
-- 
2.11.0

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---
--- Begin Message ---
Version: 1.5~beta2

On Wed, 12 Jul 2017 15:31:41 +0200 Julian Andres Klode wrote:

> limit source apt
> tags 859757 + pending

Looks like we forgot to close this bug report:

apt (1.5~beta2) unstable; urgency=medium

...

  [ Paul Wise ]
  * Support zero delay for the various APT::Periodic activities
  * Support seconds, minutes, hours and days for APT::Periodic intervals
  * Switch from /org to /srv in example apt-ftparchive configuration

-- 
bye,
pabs

https://wiki.debian.org/PaulWise

Attachment: signature.asc
Description: This is a digitally signed message part


--- End Message ---

Reply to: