Bug 2315577
| Summary: | Opening an interactive shell is slow because of /etc/zshrc | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Nadav Har'El <nyharel> |
| Component: | Lmod | Assignee: | Orion Poplawski <orion> |
| Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 40 | CC: | dmaphy, james.antill, j, kdudka, orion, svashisht, vmihalko |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Lmod-8.7.49-1.fc41 Lmod-8.7.49-1.fc40 Lmod-8.7.49-1.fc39 Lmod-8.7.49-1.el8 Lmod-8.7.49-1.el9 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2024-10-12 00:18:07 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Nadav Har'El
2024-09-29 20:27:28 UTC
By some experimentation, I discovered that the slowest part of /etc/profile.d, accounting for around 80% (!) of all the slowness, came from the "Lmod" package. I never heard of the Lmod package, nor remember deliebrately installing it. I uninstalled it, and now the interactive log in time is down to around 0.06 seconds, which is a huge visible improvement. So I'm tempted to say this is a bug in the Lmod package, not the zsh package - as it introduces this unnecessary slowness not just to zsh but also to bash. I found this page: https://utcc.utoronto.ca/~cks/space/blog/linux/Fedora40LoginStallWhy. It suggests that lmod's /usr/share/lmod/lmod/init/bash (and probably also zsh) has an unknown command which causes some slow "search for unknown command" machinery to be used. I verified that indeed trying to run an unknown command takes about 0.2 seconds on my machine - much of the slowdown I noticed. If this is true, than the immediate cause of the interactive-shell-startup slowness is this unknown command in lmod's init script that runs in every interactive shell. This can probably be easily fix - this script shouldn't try to run an unknown command. But additional questions can be asked: 1. Why does installing lmod need to initialize things in interactive shells? 2. Why does the very slow command-not-found is applied in /etc/zshrc and /etc/bashrc? If it's a fact of life, can it at least be temporary disabled in /etc/z,bashhrc? 3. Why does /etc/profile.d/* run at all in interactive, non-login shells. But I think I gave up on hoping this would be fixed - it goes against every principle of the original Unix shell design, but it seems too deeply engrained in Fedora to fix now. FEDORA-EPEL-2024-c2b8a70541 (Lmod-8.7.49-1.el8) has been submitted as an update to Fedora EPEL 8. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-c2b8a70541 FEDORA-2024-8b931bc304 (Lmod-8.7.49-1.fc41) has been submitted as an update to Fedora 41. https://bodhi.fedoraproject.org/updates/FEDORA-2024-8b931bc304 FEDORA-2024-f07875c71c (Lmod-8.7.49-1.fc39) has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2024-f07875c71c FEDORA-EPEL-2024-37543a9986 (Lmod-8.7.49-1.el9) has been submitted as an update to Fedora EPEL 9. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-37543a9986 FEDORA-2024-476878f60d (Lmod-8.7.49-1.fc40) has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2024-476878f60d FEDORA-2024-476878f60d has been pushed to the Fedora 40 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-476878f60d` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-476878f60d See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2024-f07875c71c has been pushed to the Fedora 39 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-f07875c71c` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-f07875c71c See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-EPEL-2024-c2b8a70541 has been pushed to the Fedora EPEL 8 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-c2b8a70541 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-EPEL-2024-37543a9986 has been pushed to the Fedora EPEL 9 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2024-37543a9986 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2024-8b931bc304 has been pushed to the Fedora 41 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2024-8b931bc304` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2024-8b931bc304 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates. FEDORA-2024-8b931bc304 (Lmod-8.7.49-1.fc41) has been pushed to the Fedora 41 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2024-476878f60d (Lmod-8.7.49-1.fc40) has been pushed to the Fedora 40 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-2024-f07875c71c (Lmod-8.7.49-1.fc39) has been pushed to the Fedora 39 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-EPEL-2024-c2b8a70541 (Lmod-8.7.49-1.el8) has been pushed to the Fedora EPEL 8 stable repository. If problem still persists, please make note of it in this bug report. FEDORA-EPEL-2024-37543a9986 (Lmod-8.7.49-1.el9) has been pushed to the Fedora EPEL 9 stable repository. If problem still persists, please make note of it in this bug report. |