show-motd: Show MOTD from /etc/profile.d snippet in the first shell every day

Bug #1855918 reported by Balint Reczey
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-motd (Ubuntu)
Fix Released
Undecided
Unassigned
Eoan
Fix Released
Undecided
Unassigned

Bug Description

[Impact] (Compared to LP: #1855089)

 * Users are shown MOTD once a day but only in a shell started at a later hour than the one that showed MOTD the day before. This a bit confusing and harder to predict than showing MOTD in the first started shell every day. This fix implements the latter.

[Test Case]
 * MOTD should be shown when touch refers to a date yesterday:

 $ install show-motd
 $ unset MOTD_SHOWN
 $ touch -d 'now - 23 hours' $HOME/.motd_shown
 $ bash -i /etc/profile.d/update-motd.sh
...
 $ touch -d 'now - 25 hours' $HOME/.motd_shown
 $ bash -i /etc/profile.d/update-motd.sh
...
 $ touch -d 'now - 1 hour' $HOME/.motd_shown
 $ bash -i /etc/profile.d/update-motd.sh
...

[Regression Potential]

 * Since this is an improvement of the new functionality only available in -proposed there is no extra regression potential compared to the change introducing the new functionality in LP: #1855089.

Balint Reczey (rbalint)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-motd - 3.6-0ubuntu5

---------------
update-motd (3.6-0ubuntu5) focal; urgency=medium

  * show-motd: Show MOTD from /etc/profile.d snippet in the first shell every
    day instead of showing it only after 24h is elapsed since showing it
    last time. (LP: #1855918)

 -- Balint Reczey <email address hidden> Tue, 10 Dec 2019 20:21:57 +0100

Changed in update-motd (Ubuntu):
status: New → Fix Released
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Balint, or anyone else affected,

Accepted update-motd into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-motd/3.6-0ubuntu1.19.10.1 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 on 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-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. In either case, without details of your testing we will not be able to proceed.

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

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in update-motd (Ubuntu Eoan):
status: New → Fix Committed
tags: added: verification-needed verification-needed-eoan
Revision history for this message
Balint Reczey (rbalint) wrote :

Verified with 3.6-0ubuntu1.19.10.1 :

rbalint@yogi:~$ lxc shell ee-motd-verify
root@ee-motd-verify:~# unset MOTD_SHOWN
root@ee-motd-verify:~# touch -d 'now - 23 hours' $HOME/.motd_shown
root@ee-motd-verify:~# bash -i /etc/profile.d/update-motd.sh
Welcome to Ubuntu 19.10 (GNU/Linux 5.0.0-37-generic x86_64)

 * Documentation: https://help.ubuntu.com
 * Management: https://landscape.canonical.com
 * Support: https://ubuntu.com/advantage

  System information as of Wed Dec 18 13:48:23 UTC 2019

  System load: 2.89 Processes: 29
  Usage of /home: unknown Users logged in: 0
  Memory usage: 0% IP address for eth0: 10.84.73.58
  Swap usage: 100%

0 updates can be installed immediately.
0 of these updates are security updates.

This message is shown once once a day. To disable it please create the
/root/.hushlogin file.
root@ee-motd-verify:~# touch -d 'now - 25 hours' $HOME/.motd_shown
root@ee-motd-verify:~# bash -i /etc/profile.d/update-motd.sh
Welcome to Ubuntu 19.10 (GNU/Linux 5.0.0-37-generic x86_64)

 * Documentation: https://help.ubuntu.com
 * Management: https://landscape.canonical.com
 * Support: https://ubuntu.com/advantage

  System information as of Wed Dec 18 13:48:37 UTC 2019

  System load: 2.83 Processes: 29
  Usage of /home: unknown Users logged in: 0
  Memory usage: 0% IP address for eth0: 10.84.73.58
  Swap usage: 100%

0 updates can be installed immediately.
0 of these updates are security updates.

This message is shown once once a day. To disable it please create the
/root/.hushlogin file.
root@ee-motd-verify:~# touch -d 'now - 1 hour' $HOME/.motd_shown
root@ee-motd-verify:~# bash -i /etc/profile.d/update-motd.sh
root@ee-motd-verify:~# dpkg -l show-motd | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-====================-============-=============================================
ii show-motd 3.6-0ubuntu1.19.10.1 all show message of the day in interactive shells

description: updated
tags: added: verification-done verification-done-eoan
removed: verification-needed verification-needed-eoan
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for update-motd has completed successfully and the package is now being 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.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-motd - 3.6-0ubuntu1.19.10.1

---------------
update-motd (3.6-0ubuntu1.19.10.1) eoan; urgency=medium

  * show-motd: Show MOTD from /etc/profile.d snippet in the first shell every day
    instead of showing it only after 24h is elapsed since showing it last time.
    This is easier to understand. (LP: #1855918)

update-motd (3.6-0ubuntu1.19.10.0) eoan; urgency=medium

  * Show MOTD using an /etc/profile.d snippet when it was not shown
    by PAM and it was shown more than a day ago. (LP: #1855089)
    - Add autopkgtest
    - Set MOTD_SHOWN=update-motd in /etc/profile.d after showing MOTD
    - Add Breaks: for packages with /etc/update-motd.d snippets failing as
      a normal user. Also add Breaks: on libpam-modules not setting
      MOTD_SHOWN=pam.
    - I18n the message about .hushlogin
    - Split /etc/profile.d snippet to new show-motd binary package
      to not change the behaviour of the update-motd package on upgrade.
    - update-motd.8: Update man page with new update-motd --show-only option
      and also mention the new show-motd package.
    - update-motd.sh: Don't source, but run update-motd
      This fixes being dropped out of shell when update-motd exits with
      nonzero value.
    - update-motd.sh: Don't misleadingly indicate that script is running with set -e

 -- Balint Reczey <email address hidden> Tue, 10 Dec 2019 22:12:29 +0100

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.