Merge ~mitchburton/ubuntu/+source/landscape-client:2040924-sysinfo-cache-perms into ubuntu/+source/landscape-client:ubuntu/devel

Proposed by Mitch Burton
Status: Merged
Merge reported by: Andreas Hasenack
Merged at revision: 2196fbeb81fa9d6c43095dfc62669c9409a8a453
Proposed branch: ~mitchburton/ubuntu/+source/landscape-client:2040924-sysinfo-cache-perms
Merge into: ubuntu/+source/landscape-client:ubuntu/devel
Diff against target: 32 lines (+13/-0)
2 files modified
debian/changelog (+7/-0)
debian/landscape-common.postinst (+6/-0)
Reviewer Review Type Date Requested Status
Simon Quigley (community) Approve
git-ubuntu import Pending
Review via email: mp+456212@code.launchpad.net

Description of the change

create and set read-write permissions for /var/lib/landscape/landscape-sysinfo.cache to prevent permissions errors when executing update-motd.

Behaviour prior to this change, as ubuntu user on noble:

$ /etc/update-motd.d/50-landscape-sysinfo
/etc/update-motd.d/50-landscape-sysinfo: 17: cannot create /var/lib/landscape/landscape-sysinfo.cache: Permission denied

after upgrade from PPA to 23.08-0ubuntu2~ppa0, with change in this MR. https://launchpad.net/~mitchburton/+archive/ubuntu/2040924/+packages, and waiting 2 minutes until the cache file is old enough:

$ /etc/update-motd.d/50-landscape-sysinfo
  System information as of Thu Nov 23 23:38:03 UTC 2023

  System load: 0.56 Temperature: 81.0 C
  Usage of /: 10.3% of 7.84GB Processes: 21
  Memory usage: 0% Users logged in: 0
  Swap usage: 0% IPv4 address for eth0: 10.76.244.223

To post a comment you must log in.
Revision history for this message
Simon Quigley (tsimonq2) wrote :

Uploaded, thanks!

review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This was done already.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 2479e40..4eaf917 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+landscape-client (23.08-0ubuntu2) noble; urgency=medium
7+
8+ * d/landscape-common.postint: ensure sysinfo cache file exists and is globally
9+ read-write (LP: #2040924)
10+
11+ -- Mitch Burton <mitch.burton@canonical.com> Thu, 23 Nov 2023 14:28:14 -0800
12+
13 landscape-client (23.08-0ubuntu1) mantic; urgency=medium
14
15 * New upstream release 23.08
16diff --git a/debian/landscape-common.postinst b/debian/landscape-common.postinst
17index e488296..9aeb7a5 100755
18--- a/debian/landscape-common.postinst
19+++ b/debian/landscape-common.postinst
20@@ -90,6 +90,12 @@ case "$1" in
21 WRAPPER=/usr/share/landscape/landscape-sysinfo.wrapper
22 PROFILE_LOCATION=/etc/profile.d/50-landscape-sysinfo.sh
23 UPDATE_MOTD_LOCATION=/etc/update-motd.d/50-landscape-sysinfo
24+ STAMP_LOCATION=/var/lib/landscape/landscape-sysinfo.cache
25+
26+ touch $STAMP_LOCATION
27+ chown landscape:root $STAMP_LOCATION
28+ chmod 666 $STAMP_LOCATION
29+
30 if [ "$RET" = "Cache sysinfo in /etc/motd" ]; then
31 rm -f $PROFILE_LOCATION 2>/dev/null || true
32 ln -sf $WRAPPER $UPDATE_MOTD_LOCATION

Subscribers

People subscribed via source and target branches