update-notifier presents unclear update message

Bug #1342424 reported by Robin Sheat on 2014-07-15
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-manager (Ubuntu)
Medium
Brian Murray
Precise
Undecided
Unassigned

Bug Description

TEST CASE:
1. install 12.04
2. apt-get install linux-image-generic-lts-saucy
3. install update-manager-core from precise-updates
4. run "hwe-support-status" and verify that you get a message about the support status end in the locale text format
5. install update-manager-core from precise-proposed
6. run "hwe-support-status" and verify that you get the date displayed in isoformat

I logged in to a server and got:

Your current Hardware Enablement Stack (HWE) is going out of support
on 08/07/14. After this date security updates for critical parts (kernel
and graphics stack) of your system will no longer be available.

For more information, please see:
http://wiki.ubuntu.com/1204_HWE_EOL

To upgrade to a supported (or longer supported) configuration:

* Upgrade from Ubuntu 12.04 LTS to Ubuntu 14.04 LTS by running:
sudo do-release-upgrade

OR

* Install a newer HWE version by running:
sudo apt-get install linux-generic-lts-trusty linux-image-generic-lts-trusty

and reboot your system.

That's all well and good, but 08/07/14 is not a meaningful date. Here, it's in the near past. Some places, it's in the near future. When is the HWE going out of support? Who can tell?

(NB: pretty sure I have the wrong package, but I have no idea what the real one is.)

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: update-notifier (not installed)
ProcVersionSignature: Ubuntu 3.8.0-42.63~precise1-generic 3.8.13.23
Uname: Linux 3.8.0-42-generic x86_64
ApportVersion: 2.0.1-0ubuntu17.6
Architecture: amd64
Date: Wed Jul 16 11:38:29 2014
MarkForUpload: True
SourcePackage: update-notifier
UpgradeStatus: No upgrade log present (probably fresh install)

Robin Sheat (eythian) wrote :
Steve Langasek (vorlon) on 2014-07-16
Changed in update-notifier (Ubuntu):
assignee: nobody → Michael Vogt (mvo)
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

I can reproduce this bug here. The code is using strftime("%x") so it should print a localized date. And the motd pam.d is run after the pam module loads /etc/default/locale. I'm investigating further.

Changed in update-notifier (Ubuntu):
status: New → In Progress
Robin Sheat (eythian) wrote :

Good to know what it is, probably still should be unambiguous though.

Michael Vogt (mvo) wrote :

@Nick: Yeah! Its kind of ironic that I was using iso dates before and during the internal testing it was suggested to use the dates based on the locale. Oh well.

It turns out that pam-motd runs the update-motd stuff without LANG/LOCALE information.
"""
+ if (!system("/usr/bin/env -i PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin run-parts --lsbsysinit /etc/update-motd.d > /run/motd.dynamic.new"))
"""

So to fix that, something like:
"""
  char cmd[255];
  char *language = pam_getenv(pamh, "LANGUAGE");
  if(language == NULL) language = "";
  char *lang = pam_getenv(pamh, "LANG");
  if(locale == NULL) locale = "";
  snprintf(cmd, sizeof(cmd), "/usr/bin/env -i LANGUAGE=\"%s\" LANG=\"%s\" PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin run-parts --lsbsysinit /etc/update-motd.d > /run/motd.dynamic.new", language, lang);
  if(!system(cmd))
"""
I would love to get feedback from the pam maintainer if that is something we want to support, I'm happy to write the code for this. But given the side-effects that all update-motd scripts are suddenly running localized I think simply going to iso date format in the script is the better option for now.

Michael Vogt (mvo) wrote :

Ignore the typos in the code (locale == NULL) locale = ""; should really be "lang" instead.

Michael Vogt (mvo) on 2014-07-16
Changed in update-notifier (Ubuntu):
importance: Undecided → Medium
Michael Vogt (mvo) on 2014-07-16
description: updated

Hello Robin, or anyone else affected,

Accepted update-manager into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/update-manager/1:0.156.14.16 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Robin Sheat (eythian) wrote :

Thanks, though I don't think I can test it on our servers because they're production and putting proposed on them seems not ideal. Not sure how to produce the message in a VM.

Erick Brunzell (lbsolost) wrote :

Looks good, changes date from 08/07/2014 to 2014-08-07. So marked verification-done.

tags: added: verification-done
removed: verification-needed
Changed in update-notifier (Ubuntu Precise):
status: New → Fix Committed
affects: update-notifier (Ubuntu) → update-manager (Ubuntu)

The verification of the Stable Release Update for update-manager has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-manager - 1:0.156.14.16

---------------
update-manager (1:0.156.14.16) precise-proposed; urgency=low

  * HweSupportStatus/consts.py:
    - use ISO date format instead of the locales date format because
      pam_motd does not set the LANG environment (LP: #1342424)
  * hwe-support-status:
    - fix crash with hwe-support-status --show-all-unsupported,
      thanks to "frankster" (LP: #1341324)
 -- Michael Vogt <email address hidden> Wed, 16 Jul 2014 10:38:59 +0200

Changed in update-manager (Ubuntu Precise):
status: Fix Committed → Fix Released
Changed in update-manager (Ubuntu):
assignee: Michael Vogt (mvo) → Brian Murray (brian-murray)
Brian Murray (brian-murray) wrote :

I've forward ported the HWE support status code to Yakkety, so I'm setting this to Fix Released.

Changed in update-manager (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments