LGTM, thanks!
| ubuntu@juju-87625f-hloeung-66:~$ cp /etc/cron.weekly/update-notifier-common ~/ | ubuntu@juju-87625f-hloeung-66:~$ sudo apt-get update | ... | Get:8 http://us.archive.ubuntu.com/ubuntu bionic-proposed/main amd64 Packages [104 kB] | ... | ubuntu@juju-87625f-hloeung-66:~$ sudo apt-get install update-notifier-common | ubuntu@juju-87625f-hloeung-66:~$ diff -Naurp ~/update-notifier-common /etc/cron.weekly/update-notifier-common | --- /home/ubuntu/update-notifier-common 2021-08-26 00:27:43.687383953 +0000 | +++ /etc/cron.weekly/update-notifier-common 2021-08-23 22:33:23.000000000 +0000 | @@ -4,5 +4,12 @@ set -e | | [ -x /usr/lib/ubuntu-release-upgrader/release-upgrade-motd ] || exit 0 | | -# Check to see whether there is a new version of Ubuntu available | -/usr/lib/ubuntu-release-upgrader/release-upgrade-motd | +sleep_then_check() { | + # Sleep for up to an hour to spread the load of checking for updates on | + # the Ubuntu infrastructure | + sleep $(shuf -i 1-3600 -n 1) | + # Check to see whether there is a new version of Ubuntu available | + /usr/lib/ubuntu-release-upgrader/release-upgrade-motd | +} | + | +sleep_then_check & | ubuntu@juju-87625f-hloeung-66:~$ sudo /etc/cron.weekly/update-notifier-common | ubuntu@juju-87625f-hloeung-66:~$ ps afxuww | grep sleep | root 22110 0.0 0.0 7932 740 pts/0 S 00:29 0:00 \_ sleep 767 | ubuntu@juju-87625f-hloeung-66:~$ ls -la /var/lib/ubuntu-release-upgrader/release-upgrade-available | -rw-r--r-- 1 root root 80 Aug 26 00:27 /var/lib/ubuntu-release-upgrader/release-upgrade-available | ubuntu@juju-87625f-hloeung-66:~$ New release '20.04.2 LTS' available. | Run 'do-release-upgrade' to upgrade to it. |
The additional output from the end is when it ran, LP:1940011 is to see if we can silence that to reduce weekly cron spam.
LGTM, thanks!
| ubuntu@ juju-87625f- hloeung- 66:~$ cp /etc/cron. weekly/ update- notifier- common ~/ juju-87625f- hloeung- 66:~$ sudo apt-get update us.archive. ubuntu. com/ubuntu bionic- proposed/ main amd64 Packages [104 kB] juju-87625f- hloeung- 66:~$ sudo apt-get install update- notifier- common juju-87625f- hloeung- 66:~$ diff -Naurp ~/update- notifier- common /etc/cron. weekly/ update- notifier- common update- notifier- common 2021-08-26 00:27:43.687383953 +0000 weekly/ update- notifier- common 2021-08-23 22:33:23.000000000 +0000 ubuntu- release- upgrader/ release- upgrade- motd ] || exit 0 ubuntu- release- upgrader/ release- upgrade- motd ubuntu- release- upgrader/ release- upgrade- motd juju-87625f- hloeung- 66:~$ sudo /etc/cron. weekly/ update- notifier- common juju-87625f- hloeung- 66:~$ ps afxuww | grep sleep juju-87625f- hloeung- 66:~$ ls -la /var/lib/ ubuntu- release- upgrader/ release- upgrade- available ubuntu- release- upgrader/ release- upgrade- available juju-87625f- hloeung- 66:~$ New release '20.04.2 LTS' available. upgrade' to upgrade to it.
| ubuntu@
| ...
| Get:8 http://
| ...
| ubuntu@
| ubuntu@
| --- /home/ubuntu/
| +++ /etc/cron.
| @@ -4,5 +4,12 @@ set -e
|
| [ -x /usr/lib/
|
| -# Check to see whether there is a new version of Ubuntu available
| -/usr/lib/
| +sleep_then_check() {
| + # Sleep for up to an hour to spread the load of checking for updates on
| + # the Ubuntu infrastructure
| + sleep $(shuf -i 1-3600 -n 1)
| + # Check to see whether there is a new version of Ubuntu available
| + /usr/lib/
| +}
| +
| +sleep_then_check &
| ubuntu@
| ubuntu@
| root 22110 0.0 0.0 7932 740 pts/0 S 00:29 0:00 \_ sleep 767
| ubuntu@
| -rw-r--r-- 1 root root 80 Aug 26 00:27 /var/lib/
| ubuntu@
| Run 'do-release-
|
The additional output from the end is when it ran, LP:1940011 is to see if we can silence that to reduce weekly cron spam.