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

Launchpad Bug Tracker 790050 at bugs.launchpad.net
Thu Jul 7 20:50:11 UTC 2011


This bug was fixed in the package base-files - 6.3ubuntu4

---------------
base-files (6.3ubuntu4) oneiric; urgency=low

  * Removed duplicate code in share/profile, causing /etc/profile.d/*
    scripts to be executed twice (LP: #790050)
 -- Alexander Fougner <fougner89 at gmail.com>   Sat, 18 Jun 2011 00:23:05 +0200

** Branch linked: lp:ubuntu/base-files

** Changed in: base-files (Ubuntu)
       Status: Triaged => Fix Released

-- 
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:
  Fix Released

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)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/base-files/+bug/790050/+subscriptions




More information about the foundations-bugs mailing list