Please show MOTD in containers' shell started without PAM printing MOTD

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

Bug Description

[Impact]

  * Users of containers may never see the MOTD of the container if they are always to the container's shell without PAM being involved.
  * MOTD contains important information about the system's health including the security updates to be installed thus it is desired to show MOTD in container shells, too.
  * The fix is creating a snippet in /etc/profile.d which shows, but not necessarily updates MOTD once a day.

[Test Case]

 * Install show-motd in an LXC container.
 * Observe MOTD shown when starting the container shell with
   $ lxc shell <container name>

[Regression Potential]

 * The new functionality is added in a new package, shown-motd, thus users of update-motd should not observe any regression.
 * The change in update-motd is adding the --show-only optional option. Both the new and old code patch is exercised in autopkgtest and should be safe.

[Other Info]

 * The fix relies on PAM setting MOTD_SHOWN=pam to avoid printing MOTD twice.

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

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

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

  * 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
  * update-motd.sh: Don't set "stamp" and eval_gettext()
    in /etc/profile.d script

 -- Balint Reczey <email address hidden> Sat, 07 Dec 2019 10:25:10 +0100

Changed in update-motd (Ubuntu):
status: New → Fix Released
Balint Reczey (rbalint)
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) 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.0 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
Chris Halse Rogers (raof) wrote :

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.

Revision history for this message
Balint Reczey (rbalint) wrote :

Verified with 3.6-0ubuntu1.19.10.1 :

root@ee-motd-verify:~# apt install show-motd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libfreetype6
Use 'apt autoremove' to remove it.
The following NEW packages will be installed:
  show-motd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 2304 B of archives.
After this operation, 15.4 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu eoan-proposed/main amd64 show-motd all 3.6-0ubuntu1.19.10.1 [2304 B]
Fetched 2304 B in 0s (18.4 kB/s)
Selecting previously unselected package show-motd.
(Reading database ... 30302 files and directories currently installed.)
Preparing to unpack .../show-motd_3.6-0ubuntu1.19.10.1_all.deb ...
Unpacking show-motd (3.6-0ubuntu1.19.10.1) ...
Setting up show-motd (3.6-0ubuntu1.19.10.1) ...
root@ee-motd-verify:~# logout
rbalint@yogi:~$ lxc shell ee-motd-verify
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:44:08 UTC 2019

  System load: 2.7 Processes: 28
  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:~# logout
rbalint@yogi:~$ lxc shell ee-motd-verify
root@ee-motd-verify:~#

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.