Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
Hi all My first post here Actually have the same post in fedora/red hat but nobody is responding so im guessing wrong place I am trying to run the cache ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2008
    Posts
    10

    LD_LIBRARY_PATH blank problem


    Hi all
    My first post here

    Actually have the same post in fedora/red hat but nobody is responding so im guessing wrong place

    I am trying to run the cache database and oracle client on Red hat 5
    Cache needs to use unixODBC to retrieve data from an external oracle db via the oracle client.

    This requires me to have the LD_LIBRARY_PATH and JAVA_HOME set for the root user, which i have in root's .bash_profile

    however when my cache service starts or i log into the GUI and open a terminal and i do an echo $LD_LIBRARY_PATH it comes up blank.
    if i then do a su - root and then do a $LD_LIBRARY_PATH it comes back with the correct info

    This now has me manually restarting the cache db every time the server restarts.
    e.g.

    [root@SK-DB-CA-P ~]# echo $LD_LIBRARY_PATH


    [root@SK-DB-CA-P ~]# su - root

    [root@SK-DB-CA-P ~]# echo $LD_LIBRARY_PATH

    /cachedata/bin:/orabin/oracle/10.2_client/lib:/lib:/usr/lib:/cachedata/bin

    [root@SK-DB-CA-P ~]#


    I have added the $LD_LIBRARY_PATH to /etc/profile but to no effect

    could anybody please help me or tell me what i must set where?

    Thank you

  2. #2
    Just Joined!
    Join Date
    Sep 2008
    Posts
    2
    I think you should add following lines to /etc/profile file (to the end of file):

    if ! echo ${LD_LIBRARY_PATH} | /bin/fgrep -q "/opt/intel/fc/10.1.018/lib"
    then
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/opt/intel/fc/10.1.018/lib"
    fi

    just you should change the library path

    I hope it correctly works!!!

  3. #3
    Just Joined!
    Join Date
    Sep 2008
    Posts
    10
    Hi

    Sorry i have no /opt/intel/fc/10.1.018/lib folder
    I have no folders in /opt/
    This red hat is running in VM ware, if that helps/makes a diffrence

  4. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,757
    I have added the $LD_LIBRARY_PATH to /etc/profile but to no effect
    Have you exported the variable ,if not add following line to /etc/profile

    export $LD_LIBRARY_PATH

    adding to /etc/profile and export it should work properly.

    In case you adding to .bash_profile then after editing .bash_profile file, try

    source /root/.bash_profile

    Also note each user have their own .bash_profile.
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  5. #5
    Just Joined!
    Join Date
    Sep 2008
    Posts
    2
    Quote Originally Posted by nicki vallentgoed View Post
    Hi

    Sorry i have no /opt/intel/fc/10.1.018/lib folder
    I have no folders in /opt/
    This red hat is running in VM ware, if that helps/makes a diffrence
    as I told you before, you should put your library path instead of mine!!! so you should erase "opt/intel/fc/10.1.018/lib" path then, you should write your correct library path that what you want to add...

    another option is following:

    1. open a terminal
    2. write export LD_LIBRARY_PATH=/write/your/lib/folder/path:$LD_LIBRARY_PATH

    if you close that opened terminal and if you open new terminal, you leave the LD_LIBRARY_PATH. this option works just one terminal!!!

    yes WMware is a virtual PC but not important. for many years I worked on virtual PC. I compiled many programs and library on it for testing. you can think it as a real computer. everything is same with a physical PC. If a program dose not work WMware, most probabaly it will not work in physical PC either.

    these are my experience. either it can work or it can't. just try!!!

  6. #6
    Just Joined!
    Join Date
    Sep 2008
    Posts
    10
    Hi, my .bash_profile:

    # .bash_profile

    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
    . ~/.bashrc
    fi

    # User specific environment and startup programs

    ORACLE_BASE=/orabin/oracle; export ORACLE_BASE
    ORACLE_SID=; export ORACLE_SID
    ORACLE_TERM=xterm; export ORACLE_TERM
    ORACLE_HOME=/orabin/oracle/10.2_client; export ORACLE_HOME
    JAVA_HOME=/usr/local/java/jdk1.6.0_04/jre; export JAVA_HOME
    LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH
    PATH=$PATH:/usr/sbin:$HOME/bin:$ORACLE_HOME/bin:$LD_LIBRARY_PATH; export PATH
    CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

    export $LD_LIBRARY_PATH

    unset USERNAME


    as soon as i add the export $LD_LIBRARY_PATH and do source /root/.bash_profile i get:


    [root@localhost ~]# source /root/.bash_profile
    -bash: export: `/orabin/oracle/10.2_client/lib': not a valid identifier

  7. #7
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,757

    Exclamation

    Quote Originally Posted by Lakshmipathi View Post
    export $LD_LIBRARY_PATH
    Sorry,my mistake it's (Remove $ from variable name)
    export LD_LIBRARY_PATH
    Now try
    Code:
    source /root/.bash_profile
    if want to use /etc/profile ,then make sure these entries
    # User specific environment and startup programs

    ORACLE_BASE=/orabin/oracle; export ORACLE_BASE
    ORACLE_SID=; export ORACLE_SID
    ORACLE_TERM=xterm; export ORACLE_TERM
    ORACLE_HOME=/orabin/oracle/10.2_client; export ORACLE_HOME
    JAVA_HOME=/usr/local/java/jdk1.6.0_04/jre; export JAVA_HOME
    LD_LIBRARY_PATH=$ORACLE_HOME/lib; export LD_LIBRARY_PATH
    PATH=$PATH:/usr/sbin:$HOME/bin:$ORACLE_HOME/bin:$LD_LIBRARY_PATH; export PATH
    CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

    export $LD_LIBRARY_PATH
    available in that file.

    And try
    source /etc/profile
    or
    simply restart the machine

    and check for the variable
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  8. #8
    Just Joined!
    Join Date
    Sep 2008
    Posts
    10
    Ok i have done everything but no luck.

    Let me ask, as which user do startup scripts get run?

    Becuase if i "look" at these settings from within cache databse after the system has booted:

    PATH
    /sbin:/usr/sbin:/bin:/usr/bin

    LD_LIBRARY_PATH
    /cachedata/bin

    ODBC does not work

    and after i log in as root an restart the cache database:

    PATH
    /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/sbin:/root/bin:/orabin/oracle/10.2_client/bin:/orabin/oracle/10.2_client/lib:/usr/sbin:/root/bin:/orabin/oracle/10.2_client/bin:/orabin/oracle/10.2_client/lib

    LD_LIBRARY_PATH
    /cachedata/bin


    ODBC works

    and after i su - root and then restart cache

    PATH
    /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/sbin:/root/bin:/orabin/oracle/10.2_client/bin:/orabin/oracle/10.2_client/lib:/usr/sbin:/root/bin:/orabin/oracle/10.2_client/bin:/orabin/oracle/10.2_client/lib

    LD_LIBRARY_PATH
    /cachedata/bin:/orabin/oracle/10.2_client/lib

    ODBC works


    This is confusing

  9. #9
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,757

    Post

    Quote Originally Posted by nicki vallentgoed View Post
    Ok i have done everything but no luck.

    Let me ask, as which user do startup scripts get run?
    Here is some information that may help you.

    Each user have their own
    .bash_profile
    file
    For example ,my system has 3 accounts/users
    root,lg,oss

    Then
    /root/.bash_profile will have setting related to root.

    /home/lg/.bash_profile --all the variable defined here is limited to lg.

    /home/oss/.bash_profile --all the variable defined here is limited to oss.

    If I add new variable for root in /root/.bash_profile,Then
    these values can't be accessed when you login as lg or oss.

    Similarly when you add new value to lg ,
    It can't be accessable when you login as root or oss.

    So .bash_profile is specific the each account or user.

    If you want to set variable that should be accessed all users (root,lg,oss) then added them in /etc/profile.

    Hope this Helps.
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  10. #10
    Just Joined!
    Join Date
    Sep 2008
    Posts
    10
    So when red hat is booting, as which user do the services start, since i am starting cache as a service

    Or can i set the user starting the service?

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •