[Bug 790050] Re: /etc/profile runs /etc/profile.d/*.sh twice

Charlie Kravetz charlie-tca at ubuntu.com
Fri Jun 3 15:47:58 UTC 2011


** Tags added: bitesize

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to base-files in Ubuntu.
https://bugs.launchpad.net/bugs/790050

Title:
  /etc/profile runs /etc/profile.d/*.sh twice

Status in “base-files” package in Ubuntu:
  Triaged

Bug description:
  Binary package hint: base-files

  This block of code occurs two times, so all the scripts get run two
  times:

  if [ -d /etc/profile.d ]; then
    for i in /etc/profile.d/*.sh; do
      if [ -r $i ]; then
        . $i
      fi
    done
    unset i
  fi

  juser at pc9e:/etc$ grep -n "if.*profile" /etc/profile
  4:if [ -d /etc/profile.d ]; then
  32:if [ -d /etc/profile.d ]; then

  Here is the whole thing:

  # /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
  # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

  if [ -d /etc/profile.d ]; then
    for i in /etc/profile.d/*.sh; do
      if [ -r $i ]; then
        . $i
      fi
    done
    unset i
  fi

  if [ "$PS1" ]; then
    if [ "$BASH" ]; then
      # The file bash.bashrc already sets the default PS1.
      # PS1='\h:\w\$ '
      if [ -f /etc/bash.bashrc ]; then
        . /etc/bash.bashrc
      fi
    else
      if [ "`id -u`" -eq 0 ]; then
        PS1='# '
      else
        PS1='$ '
      fi
    fi
  fi

  # The default umask is now handled by pam_umask.
  # See pam_umask(8) and /etc/login.defs.

  if [ -d /etc/profile.d ]; then
    for i in /etc/profile.d/*.sh; do
      if [ -r $i ]; then
        . $i
      fi
    done
    unset i
  fi

  ProblemType: Bug
  DistroRelease: Ubuntu 11.10
  Package: base-files 6.3ubuntu2
  ProcVersionSignature: Ubuntu 2.6.39-3.10-generic 2.6.39
  Uname: Linux 2.6.39-3-generic x86_64
  Architecture: amd64
  Date: Sun May 29 22:13:27 2011
  ProcEnviron:
   LANGUAGE=en_US:
   PATH=(custom, user)
   LANG=en_US
   SHELL=/bin/bash
  SourcePackage: base-files
  UpgradeStatus: No upgrade log present (probably fresh install)




More information about the foundations-bugs mailing list