motd [on at least some instances] does not auto-update daily

Bug #1829968 reported by Christian Reis
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
base-files (Ubuntu)
Fix Released
High
Brian Murray
Bionic
Fix Released
High
Brian Murray
Cosmic
Fix Released
Undecided
Brian Murray
Disco
Fix Released
Undecided
Brian Murray
Eoan
Fix Released
High
Brian Murray

Bug Description

[Impact]
motd-news timer is not properly configured and may not run regularly so long running systems will not get an updated motd

[Test Case]
The motd-news.timer is known to be incorrectly configured because motd-news.services is a one shot service which will not become active. Subsequently, have a timer with OnUnitActiveSec is wrong and the timer will not work reliably. However, because it can work some of the time it is difficult to find a case where the timer always fails so test case will involve only confirming that the new timer is correct.

1) On a system with curl installed, install the new version of base-files
2) Run 'systemctl list-timers motd* --all
3) Confirm that "LEFT" is less than 12 hours (Its less than 24 hours because we don't want people to miss important messages)
4) Wait until "NEXT" is reached
5) Confirm that there is another "NEXT" and that the time stamp of /var/cache/motd-news was updated

[Regression Potential]
I can't think of any on the client side as the job wasn't working as it was intended but it may cause extra load on the motd server.

Original Description
--------------------
I have a VM running on AWS. It was launched on May 9th:

  $ uptime
   05:26:21 up 12 days, 6:34, 1 user, load average: 0.00, 0.00, 0.00
  $ date
  Wed May 22 05:26:24 UTC 2019

I touched none of the system defaults, and yet the motd has not updated automatically.

  $ ls -l /var/cache/motd-news
  -rw-r--r-- 1 root root 0 May 9 22:53 /var/cache/motd-news

The systemd timer unit looks like this:

  $ systemctl status motd-news.timer
  ● motd-news.timer - Message of the Day
     Loaded: loaded (/lib/systemd/system/motd-news.timer; enabled; vendor preset: enabled)
     Active: active (elapsed) since Thu 2019-05-09 22:51:58 UTC; 1 weeks 5 days ago
    Trigger: n/a

  May 09 22:51:58 ip-172-31-23-224 systemd[1]: Started Message of the Day.

If I run /etc/update-motd.d/50-motd-news --force manually, the file does update correctly.

Revision history for this message
Christian Reis (kiko) wrote :

I think this is related to https://github.com/systemd/systemd/issues/6680, specifically this comment:

"hmm, so OnUnitActiveSec= operates relative to a unit becoming active, but Type=oneshot service units actually never become active, unless you combine them with RemainAfterExit=, hence the confusion...

Type=oneshot units after all do stuff during their start-up and when that's complete they go down again, they never stay up continiously... Hence, combining Type=oneshot with OnUnitActiveSec= can't really work... This is a big underdocumented though"

Which seems relevant, since:

  $ cat /lib/systemd/system/motd-news.service
  [Unit]
  Description=Message of the Day
  After=network-online.target
  Documentation=man:update-motd(8)

  [Service]
  Type=oneshot
  ExecStart=/etc/update-motd.d/50-motd-news --force

Steve Langasek (vorlon)
Changed in base-files (Ubuntu):
importance: Undecided → High
status: New → Triaged
Changed in base-files (Ubuntu Bionic):
importance: Undecided → High
status: New → Triaged
tags: added: id-5ce840b53fe9fc1ccbddc1fa
Revision history for this message
Brian Murray (brian-murray) wrote :

I booted multiple virtual machines to see if I could discover a difference among releases and observed the following:

bdmurray@clean-cosmic-amd64:~$ systemctl status motd-news.timer
● motd-news.timer - Message of the Day
   Loaded: loaded (/lib/systemd/system/motd-news.timer; enabled; vendor preset: enabled)
   Active: active (waiting) since Wed 2019-06-12 15:40:07 PDT; 9min ago
  Trigger: Thu 2019-06-13 04:29:53 PDT; 12h left

Jun 12 15:40:07 clean-cosmic-amd64 systemd[1]: Started Message of the Day.

bdmurray@clean-bionic-amd64:~$ systemctl status motd-news.timer
● motd-news.timer - Message of the Day
   Loaded: loaded (/lib/systemd/system/motd-news.timer; enabled; vendor preset: enabled)
   Active: active (elapsed) since Wed 2019-06-12 15:41:33 PDT; 8min ago
  Trigger: n/a

Jun 12 15:41:33 clean-bionic-amd64 systemd[1]: Started Message of the Day.

bdmurray@clean-disco-amd64:~$ systemctl status motd-news.timer
● motd-news.timer - Message of the Day
   Loaded: loaded (/lib/systemd/system/motd-news.timer; enabled; vendor preset: enabled)
   Active: active (elapsed) since Wed 2019-06-12 15:42:11 PDT; 7min ago
  Trigger: n/a

Jun 12 15:42:11 clean-disco-amd64 systemd[1]: Started Message of the Day.

My Disco desktop:
[ 3:37PM 11006 ] [ bdmurray@impulse:~/source-trees/daisy/trunk ]
 $ systemctl status motd-news.timer
● motd-news.timer - Message of the Day
   Loaded: loaded (/lib/systemd/system/motd-news.timer; enabled; vendor preset: enabled)
   Active: active (waiting) since Mon 2019-06-03 16:01:27 PDT; 1 weeks 1 days ago
  Trigger: Wed 2019-06-12 22:26:26 PDT; 6h left

Jun 03 16:01:27 impulse systemd[1]: Started Message of the Day.

My Bionic server:
[ 3:43PM 5419 ] [ bdmurray@bizarro:/tmp ]
 $ systemctl status motd-news.timer
● motd-news.timer - Message of the Day
   Loaded: loaded (/lib/systemd/system/motd-news.timer; enabled; vendor preset: enabled)
   Active: active (elapsed) since Mon 2019-05-06 09:17:35 PDT; 1 months 6 days ago
  Trigger: n/a

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

There doesn't seem to be any rhyme or reason as to which systems received the Trigger.

Changed in base-files (Ubuntu Eoan):
assignee: nobody → Brian Murray (brian-murray)
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package base-files - 10.2ubuntu3

---------------
base-files (10.2ubuntu3) eoan; urgency=medium

  * debian/motd-news.timer: Switch the timer from OnUnitActiveSec to
    OnUnitSec as the latter is correct for oneshot services. (LP: #1829968)

 -- Brian Murray <email address hidden> Thu, 13 Jun 2019 12:12:22 -0700

Changed in base-files (Ubuntu Eoan):
status: In Progress → Fix Released
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote :

The timer is still incorrect as we can see here:

 $ systemctl list-timers --all
NEXT LEFT LAST PASSED UNIT ACTIVATES
Wed 2019-07-03 10:31:55 PDT 36min left Wed 2019-07-03 09:31:58 PDT 23min ago anacron.timer anacron.service
Wed 2019-07-03 11:53:16 PDT 1h 57min left Tue 2019-07-02 22:48:05 PDT 11h ago apt-daily.timer apt-daily.service
Wed 2019-07-03 15:28:41 PDT 5h 33min left Tue 2019-07-02 15:28:41 PDT 18h ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clea
Wed 2019-07-03 22:07:28 PDT 12h left Tue 2019-07-02 01:10:22 PDT 1 day 8h ago mdmonitor-oneshot.timer mdmonitor-oneshot.ser
Thu 2019-07-04 00:00:00 PDT 14h left Wed 2019-07-03 00:00:01 PDT 9h ago logrotate.timer logrotate.service
Thu 2019-07-04 00:00:00 PDT 14h left Wed 2019-07-03 00:00:01 PDT 9h ago man-db.timer man-db.service
Thu 2019-07-04 06:45:10 PDT 20h left Wed 2019-07-03 06:18:41 PDT 3h 36min ago apt-daily-upgrade.timer apt-daily-upgrade.ser
Sun 2019-07-07 03:10:43 PDT 3 days left Sun 2019-06-30 03:11:23 PDT 3 days ago e2scrub_all.timer e2scrub_all.service
Sun 2019-07-07 23:51:21 PDT 4 days left Mon 2019-06-24 15:03:57 PDT 1 weeks 1 days ago mdcheck_start.timer mdcheck_start.service
Mon 2019-07-08 00:00:00 PDT 4 days left Mon 2019-07-01 00:00:01 PDT 2 days ago fstrim.timer fstrim.service
n/a n/a n/a n/a mdcheck_continue.timer mdcheck_continue.serv
n/a n/a Tue 2019-06-25 04:05:23 PDT 1 weeks 1 days ago motd-news.timer motd-news.service
n/a n/a n/a n/a snapd.snap-repair.timer snapd.snap-repair.ser
n/a n/a Mon 2019-06-24 15:13:25 PDT 1 weeks 1 days ago ureadahead-stop.timer ureadahead-stop.servi

14 timers listed.
[ 9:55AM 11039 ] [ bdmurray@impulse:~/source-trees/daisy/trunk ]
 $ systemctl status motd-news.timer
● motd-news.timer - Message of the Day
   Loaded: loaded (/lib/systemd/system/motd-news.timer; enabled; vendor preset: enabled)
   Active: active (elapsed) since Mon 2019-06-24 15:12:33 PDT; 1 weeks 1 days ago
  Trigger: n/a

Jun 24 15:12:33 impulse systemd[1]: Started Message of the Day.
[ 9:56AM 11041 ] [ bdmurray@impulse:~/source-trees/daisy/trunk ]
 $ apt-cache policy base-files
base-files:
  Installed: 10.2ubuntu3
  Candidate: 10.2ubuntu3
  Version table:
 *** 10.2ubuntu3 500
        500 http://192.168.10.7/ubuntu eoan/main amd64 Packages
        100 /var/lib/dpkg/status

Changed in base-files (Ubuntu Eoan):
status: Fix Released → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package base-files - 10.2ubuntu4

---------------
base-files (10.2ubuntu4) eoan; urgency=medium

  * debian/motd-news.timer: Change the timer to use an OnCalendar entry
    instead since neither OnActiveSec nor OnUnitActiveSec accomplished the
    intended goal. (LP: #1829968)

 -- Brian Murray <email address hidden> Fri, 05 Jul 2019 15:30:39 -0700

Changed in base-files (Ubuntu Eoan):
status: In Progress → Fix Released
description: updated
Changed in base-files (Ubuntu Disco):
status: New → In Progress
assignee: nobody → Brian Murray (brian-murray)
Changed in base-files (Ubuntu Cosmic):
status: New → In Progress
assignee: nobody → Brian Murray (brian-murray)
Changed in base-files (Ubuntu Bionic):
status: Triaged → In Progress
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Christian, or anyone else affected,

Accepted base-files into disco-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/base-files/10.1ubuntu9.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-disco to verification-done-disco. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-disco. 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 base-files (Ubuntu Disco):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-disco
Changed in base-files (Ubuntu Cosmic):
status: In Progress → Fix Committed
tags: added: verification-needed-cosmic
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Christian, or anyone else affected,

Accepted base-files into cosmic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/base-files/10.1ubuntu7.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-cosmic to verification-done-cosmic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-cosmic. 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
Łukasz Zemczak (sil2100) wrote :

Hello Christian, or anyone else affected,

Accepted base-files into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/base-files/10.1ubuntu2.5 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-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. 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 base-files (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Autopkgtest regression report (base-files/10.1ubuntu2.5)

All autopkgtests for the newly accepted base-files (10.1ubuntu2.5) for bionic have finished running.
There have been regressions in tests triggered by the package. Please visit the sru report page and investigate the failures.

https://people.canonical.com/~ubuntu-archive/pending-sru.html#bionic

Revision history for this message
Brian Murray (brian-murray) wrote :

I've verified this for Ubuntu 19.04 (disco) and it is good.

bdmurray@clean-disco-amd64:~$ systemctl list-timers motd* --all
NEXT LEFT LAST PASSED UNIT ACTIVATES
Wed 2019-07-17 03:06:29 PDT 11h left Tue 2019-07-16 15:43:04 PDT 2min 44s ago motd-news.timer motd-news.service

1 timers listed.
bdmurray@clean-disco-amd64:~$ systemctl list-timers motd* --all
NEXT LEFT LAST PASSED UNIT ACTIVATES
Wed 2019-07-17 16:23:31 PDT 8h left Wed 2019-07-17 03:07:01 PDT 4h 36min ago motd-news.timer motd-news.service

1 timers listed.
bdmurray@clean-disco-amd64:~$ ls -lh /var/cache/motd-news
-rw-r--r-- 1 root root 169 Jul 17 03:07 /var/cache/motd-news
bdmurray@clean-disco-amd64:~$ apt-cache policy base-files
base-files:
  Installed: 10.1ubuntu9.1

Revision history for this message
Brian Murray (brian-murray) wrote :

I've also verified this for Ubuntu 18.04 (bionic) and it too passed.

bdmurray@clean-bionic-amd64:~$ systemctl list-timers motd* --all
NEXT LEFT LAST PASSED UNIT ACTIVATES
Wed 2019-07-17 11:04:56 PDT 19h left Tue 2019-07-16 15:46:33 PDT 44s ago motd-news.timer motd-news.service

1 timers listed.
bdmurray@clean-bionic-amd64:~$ systemctl list-timers motd* --all
NEXT LEFT LAST PASSED UNIT ACTIVATES
Wed 2019-07-17 23:10:07 PDT 15h left Wed 2019-07-17 06:50:12 PDT 55min ago motd-news.timer motd-news.service

1 timers listed.
bdmurray@clean-bionic-amd64:~$ ls -lh /var/cache/motd-news
-rw-r--r-- 1 root root 169 Jul 17 06:50 /var/cache/motd-news
bdmurray@clean-bionic-amd64:~$ apt-cache policy base-files
base-files:
  Installed: 10.1ubuntu2.5

tags: added: verification-done-bionic verification-done-disco
removed: verification-needed-bionic verification-needed-disco
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package base-files - 10.1ubuntu9.1

---------------
base-files (10.1ubuntu9.1) disco; urgency=medium

  * debian/motd-news.timer: Change the timer to use an OnCalendar entry as
    that is correct for oneshot services. (LP: #1829968)

 -- Brian Murray <email address hidden> Mon, 08 Jul 2019 11:15:53 -0700

Changed in base-files (Ubuntu Disco):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for base-files 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.

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

This bug was fixed in the package base-files - 10.1ubuntu2.5

---------------
base-files (10.1ubuntu2.5) bionic; urgency=medium

  * debian/motd-news.timer: Change the timer to use an OnCalendar entry as
    that is correct for oneshot services. (LP: #1829968)

 -- Brian Murray <email address hidden> Mon, 08 Jul 2019 11:43:29 -0700

Changed in base-files (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

And the verification for Ubuntu 18.10 (cosmic) has also passed:

bdmurray@clean-cosmic-amd64:~$ apt-cache policy base-files
base-files:
  Installed: 10.1ubuntu7.1
  Candidate: 10.1ubuntu7.1
  Version table:
 *** 10.1ubuntu7.1 100
        100 /var/lib/dpkg/status
     10.1ubuntu7 500
        500 http://ubuntu.osuosl.org/ubuntu cosmic/main amd64 Packages
bdmurray@clean-cosmic-amd64:~$ systemctl list-timers motd* --all
NEXT LEFT LAST PASSED UNIT ACTIVATES
Wed 2019-07-17 22:01:58 PDT 13h left Wed 2019-07-17 08:02:02 PDT 1min 35s ago motd-news.timer motd-news.service

1 timers listed.
bdmurray@clean-cosmic-amd64:~$ systemctl list-timers motd* --all
NEXT LEFT LAST PASSED UNIT ACTIVATES
Wed 2019-07-17 22:01:58 PDT 8h left Wed 2019-07-17 08:02:02 PDT 5h 2min ago motd-news.timer motd-news.service

1 timers listed.
bdmurray@clean-cosmic-amd64:~$ systemctl list-timers motd* --all
NEXT LEFT LAST PASSED UNIT ACTIVATES
Thu 2019-07-18 10:10:54 PDT 2h 17min left Wed 2019-07-17 22:02:39 PDT 9h ago motd-news.timer motd-news.service

1 timers listed.
bdmurray@clean-cosmic-amd64:~$ ls -lh /var/cache/motd-news
-rw-r--r-- 1 root root 0 Jul 17 22:02 /var/cache/motd-news

tags: added: verification-done-cosmic
removed: verification-needed-cosmic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package base-files - 10.1ubuntu7.1

---------------
base-files (10.1ubuntu7.1) cosmic; urgency=medium

  * debian/motd-news.timer: Change the timer to use an OnCalendar entry as
    that is correct for oneshot services. (LP: #1829968)

 -- Brian Murray <email address hidden> Mon, 08 Jul 2019 11:37:37 -0700

Changed in base-files (Ubuntu Cosmic):
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.