Adding path to boot-environment on solaris 10, sparc

Posted on 2007-08-08
Last Modified: 2013-12-27
I have installed csw and have libraries in /opt/csw/lib on my sunfire v445 with solaris 10. How do I include that path in the boot-environment? I have set bash as shell for root (passwd -e root ) and added .bashrc in / but the file is not beeing sourced when I login as root. Is there an additional file where I should source the file?
I have edited the /etc/profile and included the lines below. Is that the way to do it?


export MANPATH=${MANPATH}:/usr/local/man:/usr/share/man:/usr/perl5/5.6.1/man:/opt/csw/share/man
export PATH
source /.bashrc

Question by:gcssolve
    LVL 16

    Expert Comment

    by:Hanno Schröder
    I think you talk about your user environment, not the "boot environment", right?

    Depending if you (or your users) have a Bourne/Korn/Bash or a C-Shell, you may either add the entries inte /etc/profile or /etc/login

    Also, if the changes are only for specific users and not for all users logging in to the system, you may want to add it to the user's .profile or .login (in theit HOME dirs) instead.

    If you need these added environment settings to start up a certain application, you will have to create a startup file (rc-file):
    a) copy /etc/init.d/nscd to /etc/init.d/myscript
    b) Modify it to add the changed environment settings (as stated by you earlier) and start (and stop) your application
    c) Create a hardlink to /etc/rc3.d/Sxymyscript to have it started upon boot
        # ln /etc/init.d/myscript /etc/rc3.d/Sxymyscript
    d) Create a hardlink to /etc/rc0.d/Kxymyscript to have it shut down upon system shutdown
        # ln /etc/init.d/myscript /etc/rc0.d/Kxymyscript
    The "xy" above are numbers to have it sorted into order with other scripts in these directories. Do a
      # ls -1 /etc/rc?.d to see what's there already
    LVL 3

    Accepted Solution

    crle -u -l /opt/csw/lib
    LVL 16

    Assisted Solution

    by:Hanno Schröder
    What aaron suggests, is to update (-u) your environemnt for the runtime linker.
    It defines how the runtime linker searches when a program requires additional libraries.

    I don't know if this is what you requested, though ...

    Do a
     # crle
    to see what's actually configured.
     # clre -u -l <path>
    appends the given path <path> to the linker's config file. See manual page for clre to learn more.

    Please give us some feedback if your question has been answered.
    LVL 3

    Expert Comment

    LD_LIBRARY_PATH is just evil and really should be avoided at all costs. If you don't believe me just do a search for LD_LIBRARY_PATH in google and within the first few results you'll get examples of why it is bad.

    It's also a bad idea to set root's shell to something that may not be available in single user mode, but that's not your issue right now. ;)

    Author Comment

    Have been on vacation - just got married - but now I'm back.
    Thanks for the advice on LIBRARY_PATH. I have listened and learned! Adding the path to the runtime linker seems to be the solution to my problem. I guess the points go to aaron - right?
    LVL 16

    Expert Comment

    by:Hanno Schröder
    you may also split -- or give all ppints to aaron

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

    Title # Comments Views Activity
    sddpcm 1 58
    Streamline a For loop in Ksh 3 28
    Ubuntu install gnome-session-fallback is failing 4 77
    Unix/bash: scripted arithmetic 13 66
    Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
    Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    This tutorial goes over how to archive and restore FreeBSD jails that are managed by ezjail.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now