Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not call update-motd in maintainer scripts #201

Merged

Conversation

Perfect5th
Copy link
Contributor

d/landscape-common.postint, d/landscape-common.prerm: do not call update-motd when installing/removing landscape-sysinfo.wrapper

See bug reports:

Prior to this change, output during installation:

ubuntu@together-hawk:~$ sudo apt install landscape-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  landscape-common
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 88.6 kB of archives.
After this operation, 430 kB of additional disk space will be used.
Get:1 http://ppa.launchpad.net/landscape/self-hosted-beta/ubuntu focal/main amd64 landscape-common amd64 23.10+git6308+1-0ubuntu0 [88.6 kB]
Fetched 88.6 kB in 1s (74.9 kB/s)           
Preconfiguring packages ...
Selecting previously unselected package landscape-common.
(Reading database ... 32114 files and directories currently installed.)
Preparing to unpack .../landscape-common_23.10+git6308+1-0ubuntu0_amd64.deb ...
Unpacking landscape-common (23.10+git6308+1-0ubuntu0) ...
Setting up landscape-common (23.10+git6308+1-0ubuntu0) ...
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 6.2.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 13 22:32:12 UTC 2023

  System load:  0.75              Temperature:           72.0 C
  Usage of /:   11.7% of 6.12GB   Processes:             33
  Memory usage: 0%                Users logged in:       0
  Swap usage:   0%                IPv4 address for eth0: 10.76.244.112


Expanded Security Maintenance for Applications is not enabled.

0 updates can be applied immediately.

Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status

New release '22.04.3 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


*** System restart required ***
Processing triggers for man-db (2.9.1-1) ...

After this change:

ubuntu@nice-gecko:~$ sudo apt install ./common.deb 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'landscape-common' instead of './common.deb'
The following package was automatically installed and is no longer required:
  libfreetype6
Use 'sudo apt autoremove' to remove it.
The following packages will be upgraded:
  landscape-common
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/108 kB of archives.
After this operation, 20.5 kB of additional disk space will be used.
Get:1 /home/ubuntu/common.deb landscape-common amd64 23.11-0ubuntu0~test0 [108 kB]
Preconfiguring packages ...          
(Reading database ... 32194 files and directories currently installed.)
Preparing to unpack /home/ubuntu/common.deb ...
Unpacking landscape-common (23.11-0ubuntu0~test0) over (19.12-0ubuntu4.3) ...
Setting up landscape-common (23.11-0ubuntu0~test0) ...
Processing triggers for man-db (2.9.1-1) ...

landscape-sysinfo.cache is still created

ubuntu@nice-gecko:~$ cat /var/lib/landscape/landscape-sysinfo.cache

  System information as of Wed Dec 13 22:38:40 UTC 2023

  System load:  1.34              Temperature:           79.0 C
  Usage of /:   11.7% of 6.12GB   Processes:             31
  Memory usage: 1%                Users logged in:       0
  Swap usage:   0%                IPv4 address for eth0: 10.76.244.15

update-motd when installing/removing landscape-sysinfo.wrapper
@panlinux
Copy link
Collaborator

When the landscape-common package is removed, is the sysinfo motd message also removed?

@Perfect5th
Copy link
Contributor Author

In the prerm,/etc/update-motd.d/50-landscape-sysinfo is removed. Removing this file immediately makes it so the sysinfo motd message is removed, even if update-motd is not run.

Tested by manually removing it:

buntu@innocent-glowworm:~$ run-parts /etc/update-motd.d/
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 6.2.0-37-generic x86_64)

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

  System information as of Fri Dec 15 22:09:06 UTC 2023

  System load:    1.64      Temperature:           64.0 C
  Usage of /home: unknown   Processes:             28
  Memory usage:   0%        Users logged in:       0
  Swap usage:     0%        IPv4 address for eth0: 10.76.244.106

Expanded Security Maintenance for Applications is not enabled.

0 updates can be applied immediately.

Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status


The list of available updates is more than a week old.
To check for new updates run: sudo apt update

ubuntu@innocent-glowworm:~$ sudo rm -f /etc/update-motd.d/50-landscape-sysinfo 

ubuntu@innocent-glowworm:~$ run-parts /etc/update-motd.d/
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 6.2.0-37-generic x86_64)

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

Expanded Security Maintenance for Applications is not enabled.

0 updates can be applied immediately.

Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status


The list of available updates is more than a week old.
To check for new updates run: sudo apt update
ubuntu@innocent-glowworm:~$ sudo update-motd
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 6.2.0-37-generic x86_64)

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

Expanded Security Maintenance for Applications is not enabled.

0 updates can be applied immediately.

Enable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro status

Looking at the source for update-motd, all it seems to do regarding update-motd.d is run-parts on it.

Copy link
Collaborator

@panlinux panlinux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, but I noticed other tech debt and just plain wrong things in the maintainer scripts, historical. I'll file separate bugs.

@Perfect5th Perfect5th merged commit e812505 into canonical:master Jan 15, 2024
5 checks passed
@Perfect5th Perfect5th deleted the 2040924-dont-call-update-motd branch January 15, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants