Link to home
Start Free TrialLog in
Avatar of gcssolve
gcssolve

asked on

Adding path to boot-environment on solaris 10, sparc

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?

...

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/opt/sfw/lib:/opt/csw/lib
PATH=${PATH}:/usr/local/mysql/bin:/usr/openwin/bin:/usr/etc/appletalk:/usr/etc/venture/bin:/usr/local/bin:/opt/sfw/bin:/usr/ccs/bin:/usr/local/bin/twm:/opt/csw/bin:/opt/csw/sbin
export MANPATH=${MANPATH}:/usr/local/man:/usr/share/man:/usr/perl5/5.6.1/man:/opt/csw/share/man
export PATH
export LD_LIBRARY_PATH
source /.bashrc


thanks
Avatar of Hanno P.S.
Hanno P.S.
Flag of Germany image

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
ASKER CERTIFIED SOLUTION
Avatar of aaron757
aaron757

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aaron757
aaron757

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. ;)
Avatar of gcssolve

ASKER

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?
you may also split -- or give all ppints to aaron