Bug 152143 - Logging in on a loaded machne slows because of slow egrep in pathmunge function of /etc/profile
Logging in on a loaded machne slows because of slow egrep in pathmunge functi...
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: setup (Show other bugs)
3.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
: FutureFeature
Depends On:
Blocks: 152351
  Show dependency treegraph
 
Reported: 2005-03-25 05:28 EST by Stoyan Genov
Modified: 2014-03-16 22:53 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-03-28 15:22:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stoyan Genov 2005-03-25 05:28:36 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.6) Gecko/20041029 Firefox/0.8

Description of problem:
When a machine is loaded (high I/O, a lot of processes), logins to it are further delayed because /etc/profile is parsed upon login, and in the pathmunge() function there, it takes a lot of time to exec egrep command

Version-Release number of selected component (if applicable):
setup-2.5.27-1

How reproducible:
Sometimes

Steps to Reproduce:
1. Load a machine (load above 10 on a 2xXeon/2.8Ghz with 15+% I/O wait)
2. Login (console or ssh) with pathmunge calls enabled in /etc/profile
3. Login (console or ssh) with pathmunge calls commented out in /etc/profile
4. Profile time of parsing of /etc/profile via ``date'' in beginning, before first pathmunge(), after last pathmunge(), at end of file

Actual Results:  99% of the time /etc/profile is executing egrep's, which delays login time significantly

Expected Results:  Change pathmunge() function to use internal variable pattern matching functions

Additional info:

pathmunge () {
        if [ X"$PATH" == X"${PATH//:$1}" -a  \
             X"$PATH" == X"${PATH//$1:}" ]; then
                [ X"$2" != X"after" ] && PATH=$1:$PATH || PATH=$PATH:$1
        fi
}
Comment 1 Suzanne Hillman 2005-03-28 14:31:48 EST
Internal RFE bug #152351 opened; will be considered for future releases.
Comment 2 Bill Nottingham 2005-03-28 15:22:08 EST
Uses bash-specific syntax in a file sourced by non-bash shells.

Note You need to log in before you can comment on or make changes to this bug.