group.of.nepali.translators team mailing list archive
-
group.of.nepali.translators team
-
Mailing list archive
-
Message #36802
[Bug 1888572] Re: motd-news: use wget instead of curl
This bug was fixed in the package base-files - 9.4ubuntu4.13
---------------
base-files (9.4ubuntu4.13) xenial; urgency=medium
[ Andreas Hasenack ]
* motd/50-motd-news: don't include uptime in the user-agent string
(LP: #1886572)
* Move the /etc/default/motd-news conffile to the motd-news-config
package (LP: #1888575):
- d/postinst.in, d/postrm, d/preinst: remove /etc/default/motd-news
config file on base-files upgrade using dpkg-maintscript-helper
- d/rules: install d/preinst
- d/control: break on ubuntu-server << 1.361.5 to force an upgrade if
it is installed, which will pull motd-news-config and the conffile
back in
- d/control: new motd-news-config package, carrying the
configuration file for the /etc/update-motd.d/50-motd-news script.
- d/motd-news-config.postinst:
+ handle the upgrade case where the motd-news config file was
changed while it belonged to base-files
+ disable motd-news if the config file was removed by hand before
the upgrade
- d/postinst.in: signal the motd-news-config package if the
motd-news config file was removed manually before the upgrade
- d/conffiles: remove motd-news
- d/rules, d/motd-news-config.conffiles: packaging motd-news-config
without debhelper
[ Steve Langasek ]
* motd/50-motd-news: use wget instead of curl, since wget is standard but
curl is optional (LP: #1888572):
- This changes the timeout behavior slightly because wget does not have
an exact equivalent to curl's --max-time argument, we are using
--timeout instead.
-- Andreas Hasenack <andreas@xxxxxxxxxxxxx> Mon, 17 Aug 2020 11:19:19
-0300
** Changed in: base-files (Ubuntu Xenial)
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1888572
Title:
motd-news: use wget instead of curl
Status in base-files package in Ubuntu:
Fix Released
Status in base-files source package in Xenial:
Fix Released
Status in base-files source package in Bionic:
Fix Released
Status in base-files source package in Focal:
Fix Released
Bug description:
[Impact]
The motd-news script is using curl, but since that is an optional package, there is no guarantee that it will be installed. The script correctly checks for its presence before trying to use it, though, so it won't fail. As we don't want to add such a dependency to the base-files package, we should switch to wget, which is standard.
[Test Case]
wget has a different behavior than curl in some areas, one of which is crucial for the motd-per-cloud feature. While curl will only complain about a 404 from the server if given a specific parameter (-f), wget does that by default, and needs special handling.
a) With curl, base-files and ubuntu-server installed, first verify motd-news works:
$ sudo /etc/update-motd.d/50-motd-news --force
* Are you ready for Kubernetes 1.19? It's nearly here! Try RC3 with
sudo snap install microk8s --channel=1.19/candidate --classic
https://microk8s.io/ has docs and details.
Now remove curl, and retry. It should exit immediately with no output:
$ sudo /etc/update-motd.d/50-motd-news --force
Install the updated base-files package and the new motd-news-config
package from proposed:
$ sudo apt install base-files motd-news-config
Note curl is still not available:
$ curl
Command 'curl' not found, but can be installed with:
sudo apt install curl
Re-run the motd-news script, this time it should produce output again:
$ sudo /etc/update-motd.d/50-motd-news --force
* Are you ready for Kubernetes 1.19? It's nearly here! Try RC3 with
sudo snap install microk8s --channel=1.19/candidate --classic
https://microk8s.io/ has docs and details.
b) Verify motd-news per cloud remains working.
If you have /usr/bin/cloud-id, copy it to a backup:
sudo cp /usr/bin/cloud-id{,.orig}
Create a new one, per supported cloud. For aws, for example:
echo -e '#!/bin/sh\necho aws' | sudo tee /usr/bin/cloud-id
Confirm by running it:
$ cloud-id
aws
And confirm motd-news keeps working (it might return different content):
$ sudo /etc/update-motd.d/50-motd-news --force
* Are you ready for Kubernetes 1.19? It's nearly here! Try RC3 with
sudo snap install microk8s --channel=1.19/candidate --classic
https://microk8s.io/ has docs and details.
Repeat for the gce and azure clouds, by changing the cloud-id script
accordingly.
To confirm the right cloud_id is being used, use sh -x and grep for
its output:
$ sudo sh -x /etc/update-motd.d/50-motd-news --force 2>&1 | grep -wE 'wget .*cloud_id/[a-z]+'
+ wget --timeout 60 -U wget/1.20.3-1ubuntu1 Ubuntu/20.04.1/LTS GNU/Linux/5.4.0-42-generic/x86_64 Intel(R)/Core(TM)/i7-7600U/CPU/@/2.80GHz cloud_id/azure -O- --content-on-error https://motd.ubuntu.com
This also verifies again it's using wget instead of curl.
[Regression Potential]
Possible regressions will likely be tied to a difference in behavior between curl and wget. In fact, one was caught[1] in the development release and the fix is included here, with a test.
[Other Info]
N/A
1. https://bugs.launchpad.net/bugs/1889117
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/base-files/+bug/1888572/+subscriptions