Although /run/motd.dynamic is being updated, it's being updated after
being displayed, which is why you see the old one from the previous
login. After commenting out the second line with no arguments:

session    optional     pam_motd.so # [1]

/run/motd.dynamic was no longer being updated on login so I knew this
was the line triggering the udpate.

After moving the noupdate to this line I was seeing the freshly
generated motd.dynamic on login.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to shadow in Ubuntu.
https://bugs.launchpad.net/bugs/1368864

Title:
  old motd is displayed on login

Status in shadow package in Ubuntu:
  Triaged

Bug description:
  On Trusty, during login, the motd displayed is from the cache file
  /run/motd.dynamic. After being displayed, the scripts from /etc
  /update-motd.d are run to refresh /run/motd.dynamic. This behavior of
  displaying the cache first is not very convenient and didn't happen on
  Precise. This is also does not match the documentation (man 5 update-
  motd) nor the users' expectations.

  Steps to reproduce:

  $ cat << "EOF" | sudo tee /etc/update-motd.d/60-test
  #!/bin/sh
  printf "motd from: $(date +%T)\n"
  EOF
  $ sudo chmod +x /etc/update-motd.d/60-test

  
  $ echo 'echo "real time: $(date +%T)";exit' | ssh -T localhost
  Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-35-generic x86_64)

   * Documentation:  https://help.ubuntu.com/
  motd from: 6:05:43
  real time: 12:36:14

  The above is just an example of how old/stale the output can be.

  More details:

  $ lsb_release -rd
  Description:  Ubuntu 14.04.1 LTS
  Release:      14.04
  $ apt-cache policy libpam-modules
  libpam-modules:
    Installed: 1.1.8-1ubuntu2
    Candidate: 1.1.8-1ubuntu2
    Version table:
   *** 1.1.8-1ubuntu2 0
          500 http://archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
          100 /var/lib/dpkg/status

  ProblemType: Bug
  DistroRelease: Ubuntu 14.04
  Package: libpam-modules 1.1.8-1ubuntu2
  ProcVersionSignature: Ubuntu 3.13.0-36.63-generic 3.13.11.6
  Uname: Linux 3.13.0-36-generic x86_64
  ApportVersion: 2.14.1-0ubuntu3.4
  Architecture: amd64
  CurrentDesktop: Unity
  Date: Fri Sep 12 12:22:09 2014
  InstallationDate: Installed on 2014-01-26 (228 days ago)
  InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Alpha amd64 (20140124)
  SourcePackage: pam
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/1368864/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to