WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: /etc/profile.d  (Read 2914 times)

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
/etc/profile.d
« on: February 22, 2010, 07:16:54 PM »
What about adding an /etc/profile.d feature? Right now, there is not a simple means for an extension to insert a script into the login process. In a typical linux distribution, I like to put

export JAVA_HOME=/usr/local/java

into a script placed in /etc/profile.d. This is cleaner than modifying /etc/profile (which one should avoid). It is simple to modify /etc/profile to add this feature:

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

but I imagine others would find it useful so I am suggesting it as a feature for the base. FWIW, it is mentioned in the LSB.


Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: /etc/profile.d
« Reply #1 on: February 23, 2010, 12:36:08 PM »
Sounds good.
10+ Years Contributing to Linux Open Source Projects.