Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: danielibarnes on February 22, 2010, 07:16:54 PM

Title: /etc/profile.d
Post by: danielibarnes 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 (http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/etc.html).

Title: Re: /etc/profile.d
Post by: roberts on February 23, 2010, 12:36:08 PM
Sounds good.