Ubuntu Pastebin

Paste from None at Wed, 26 Apr 2017 18:05:37 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
diff --git a/debian/apt-daily-upgrade.service b/debian/apt-daily-upgrade.service
new file mode 100644
index 000000000..bf2776ac8
--- /dev/null
+++ b/debian/apt-daily-upgrade.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Daily apt upgrade and clean activities
+Documentation=man:apt(8)
+ConditionACPower=true
+After=apt-daily.service
+
+[Service]
+Type=oneshot
+ExecStart=/usr/lib/apt/apt.systemd.daily install
diff --git a/debian/apt-daily-upgrade.timer b/debian/apt-daily-upgrade.timer
new file mode 100644
index 000000000..79caf3b5c
--- /dev/null
+++ b/debian/apt-daily-upgrade.timer
@@ -0,0 +1,11 @@
+[Unit]
+Description=Daily apt upgrade and clean activities
+After=apt-daily.timer
+
+[Timer]
+OnCalendar=*-*-* 6:00
+RandomizedDelaySec=60m
+Persistent=true
+
+[Install]
+WantedBy=timers.target
diff --git a/debian/apt-daily.service b/debian/apt-daily.service
index 904ed5d51..4a946afdd 100644
--- a/debian/apt-daily.service
+++ b/debian/apt-daily.service
@@ -1,9 +1,9 @@
 [Unit]
-Description=Daily apt activities
+Description=Daily apt download activities
 Documentation=man:apt(8)
 ConditionACPower=true
 
 [Service]
 Type=oneshot
-ExecStart=/usr/lib/apt/apt.systemd.daily
+ExecStart=/usr/lib/apt/apt.systemd.daily update
 
diff --git a/debian/apt-daily.timer b/debian/apt-daily.timer
index 8ac13b0e9..735da2440 100644
--- a/debian/apt-daily.timer
+++ b/debian/apt-daily.timer
@@ -1,11 +1,11 @@
 [Unit]
-Description=Daily apt activities
+Description=Daily apt download activities
 After=network-online.target
 Wants=network-online.target
 
 [Timer]
-OnCalendar=*-*-* 6:00
-RandomizedDelaySec=60m
+OnCalendar=*-*-* 6,18:00
+RandomizedDelaySec=12h
 Persistent=true
 
 [Install]
diff --git a/debian/apt.systemd.daily b/debian/apt.systemd.daily
index 03d41bae5..54a8871ea 100755
--- a/debian/apt.systemd.daily
+++ b/debian/apt.systemd.daily
@@ -384,6 +384,7 @@ if [ $UpdateInterval -eq 0 ] &&
     exit 0
 fi
 
+if [ "$1" = "update" -o -z "$1" ] ; then
     # deal with BackupArchiveInterval
     do_cache_backup $BackupArchiveInterval
 
@@ -433,7 +434,9 @@ if [ $UPDATED -eq 1 ] && check_stamp $DOWNLOAD_UPGRADEABLE_STAMP $DownloadUpgrad
     else
 	debug_echo "download upgradable (not run)"
     fi
+fi
 
+if [ "$1" = "install" -o -z "$1" ] ; then
     # auto upgrade all upgradeable packages
     UPGRADE_STAMP=/var/lib/apt/periodic/upgrade-stamp
     if which unattended-upgrade >/dev/null 2>&1 && check_stamp $UPGRADE_STAMP $UnattendedUpgradeInterval; then
@@ -475,6 +478,7 @@ fi
 
     # check cache size 
     check_size_constraints
+fi
 
 #
 #     vim: set sts=4 ai :
Download as text