[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4544
  • Last Modified:

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?


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

  • 3
  • 2
2 Solutions
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
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
crle -u -l /opt/csw/lib
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
What aaron suggests, is to update (-u) your environemnt for the runtime linker.
It defines how the runtime linker ld.so 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.
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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. ;)
gcssolveAuthor Commented:
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?
Hanno P.S.IT Consultant and Infrastructure ArchitectCommented:
you may also split -- or give all ppints to aaron

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now