[Bug 1893716] Re: scripts in /etc/update-motd.d/ run even on login via non-interactive scp and sftp sessions
Christian Ehrhardt
1893716 at bugs.launchpad.net
Wed Mar 30 10:09:03 UTC 2022
With the three combined I get down to:
real 0m20.900s
us sy id wa st
32 33 35 0 0
43.88% swapper
21.48% sshd
3.07% dbus-daemon
2.78% systemd
2.10% gdbus
1.96% grep
1.80% run-parts
1.68% systemd-logind
1.38% find
1.24% systemd-journal
1.23% bash
1.12% update-motd-fsc
1.10% cat
0.95% awk
0.85% 50-motd-news
0.76% uname
0.70% 00-header
0.69% 91-release-upgr
0.67% 97-overlayroot
0.67% 50-landscape-sy
0.62% date
0.61% 90-updates-avai
0.56% 95-hwe-eol
0.54% cut
None of the remaining big contributions to consumption is from the MOTD
efforts (all <2%).
That is reasonable, nice time gain as well as reduced cpu consumption.
** Changed in: landscape-client (Ubuntu)
Status: New => In Progress
** Changed in: ubuntu-release-upgrader (Ubuntu)
Status: New => In Progress
** Changed in: update-notifier (Ubuntu)
Status: New => In Progress
** Changed in: update-notifier (Ubuntu)
Assignee: (unassigned) => Christian Ehrhardt (paelzer)
** Changed in: ubuntu-release-upgrader (Ubuntu)
Assignee: (unassigned) => Christian Ehrhardt (paelzer)
** Changed in: landscape-client (Ubuntu)
Assignee: (unassigned) => Christian Ehrhardt (paelzer)
** Changed in: landscape-client (Ubuntu)
Importance: Undecided => Critical
** Changed in: ubuntu-release-upgrader (Ubuntu)
Importance: Undecided => High
** Changed in: update-notifier (Ubuntu)
Importance: Undecided => High
** Changed in: update-motd (Ubuntu)
Importance: High => Medium
** Changed in: pam (Ubuntu)
Importance: High => Medium
** Changed in: update-motd (Ubuntu)
Status: Confirmed => Invalid
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-notifier in Ubuntu.
https://bugs.launchpad.net/bugs/1893716
Title:
scripts in /etc/update-motd.d/ run even on login via non-interactive
scp and sftp sessions
Status in landscape-client package in Ubuntu:
In Progress
Status in pam package in Ubuntu:
Confirmed
Status in ubuntu-release-upgrader package in Ubuntu:
In Progress
Status in update-motd package in Ubuntu:
Invalid
Status in update-notifier package in Ubuntu:
In Progress
Bug description:
My client has 200+ devices automatically uploading information via
sftp and scp to a server every few minutes. After a recent update, I
noticed the load on their server spiking through the roof. Upon
investigation, I discovered a horde of landscape-sysinfo and
/usr/bin/lsb_release processes running that correlated with login
session notifications in /var/log/syslog and the load spikes.
It appears that even in non-interactive sessions where this
information will never be seen, the configuration options below in
/etc/pam.d/sshd cause these items to be launched (in fact, probably
everything in /etc/update-motd.d). This only started on the system in
question after a recent set of system updates were installed.
The content of /etc/update-motd.d/* really, really, really shouldn't
be executed if the session in question is not interactive, as it
provides no value at all. Unfortunately, to disable it for these non-
interactive sessions, we also have to disable it for the interactive
ones as well where it has some value (though not enough to make
spiking the load on this server through the roof an acceptable
tradeoff).
# Print the message of the day upon successful login.
# This includes a dynamically generated part from /run/motd.dynamic
# and a static (admin-editable) part from /etc/motd.
#session optional pam_motd.so motd=/run/motd.dynamic
#session optional pam_motd.so noupdate
Also, looking at the script 00-header in /etc/update-motd.d/,
/usr/bin/lsb_release is being improperly launched, as /etc/lsb_release
does include the necessary information:
[ -r /etc/lsb-release ] && . /etc/lsb-release
if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
# Fall back to using the very slow lsb_release utility
DISTRIB_DESCRIPTION=$(lsb_release -s -d)
fi
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.7 LTS"
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/landscape-client/+bug/1893716/+subscriptions
More information about the foundations-bugs
mailing list