Debian Bug report logs - #1012602
dynamic-motd: Makes SSH login horribly slow, even if MOTD isn't shown

version graph

Package: dynamic-motd; Maintainer for dynamic-motd is Debian OpenStack <[email protected]>; Source for dynamic-motd is src:dynamic-motd (PTS, buildd, popcon).

Reported by: Axel Beckert <[email protected]>

Date: Fri, 10 Jun 2022 01:09:01 UTC

Severity: normal

Found in version dynamic-motd/0.04-1

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], [email protected], Debian OpenStack <[email protected]>:
Bug#1012602; Package dynamic-motd. (Fri, 10 Jun 2022 01:09:03 GMT) (full text, mbox, link).


Acknowledgement sent to Axel Beckert <[email protected]>:
New Bug report received and forwarded. Copy sent to [email protected], Debian OpenStack <[email protected]>. (Fri, 10 Jun 2022 01:09:03 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Axel Beckert <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: dynamic-motd: Makes SSH login horribly slow, even if MOTD isn't shown
Date: Fri, 10 Jun 2022 03:07:05 +0200
Package: dynamic-motd
Version: 0.04-1
Severity: normal

Before installing dynamic-motd, (key-based) "ssh root@localhost" was
more or less instantaneous (below 1 second).

Since installing dynamic-motd it takes about 40 seconds to login on that
box, even via localhost and even despite being a not so slow box (a
quad-core workstation with a single X session and lot of xterms and
outgoing SSH sessions):

~ → lscpu | fgrep "Model name"; uptime; date; ssh localhost date
Model name:                      Intel(R) Core(TM) i7-6700T CPU @ 2.80GHz
 02:34:23 up 55 days,  7:39, 196 users,  load average: 3.09, 3.52, 3.28
Fri Jun 10 02:34:23 CEST 2022
Fri Jun 10 02:35:05 CEST 2022
~ →

Most time seems to be spent for calling checkrestart (33 seconds). If
only needrestart would have been installed, that step would even have
taken even longer (4 minutes and 18 seconds; phew!)

So please try to at least cache the results of checkrestart and
needrestart. Or maybe pre-calculate them via cron-job once an hour or
so. Or disable them completely by default.

For those suffering from this issue as well, here's how I solved it for
myself:

# dpkg-divert  --local  --rename --divert /etc/update-motd.d/50-services-need-restart.DISABLED --add /etc/update-motd.d/50-services-need-restart

Now I'm down to about 8 seconds for logging in via SSH.

-- System Information:
Debian Release: bookworm/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (600, 'testing'), (500, 'unstable-debug'), (500, 'buildd-unstable'), (110, 'experimental'), (1, 'experimental-debug'), (1, 'buildd-experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.16.0-6-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
LSM: AppArmor: enabled

Versions of packages dynamic-motd depends on:
ii  bc            1.07.1-3+b1
ii  figlet        2.2.5-3+b1
ii  lsb-release   11.2
ii  python3       3.10.4-1+b1
ii  python3-utmp  0.9-1+b5

dynamic-motd recommends no packages.

dynamic-motd suggests no packages.

-- no debconf information



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Sun Sep 22 09:27:19 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.