Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 15 of 15
So when red hat is booting, as which user do the services start It starts with root user permissions. But again,simply placing variable in /etc/profile should work. Post your /etc/profile ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,758

    Exclamation


    So when red hat is booting, as which user do the services start
    It starts with root user permissions.

    But again,simply placing variable in /etc/profile should work.

    Post your /etc/profile here ..
    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

  2. #12
    Just Joined!
    Join Date
    Sep 2008
    Posts
    10
    It starts with root user permissions.
    If that is so then why do i have to su - root to get it to show my $LD_LIBRARY_PATH values:

    [root@localhost ~]# echo $LD_LIBRARY_PATH

    [root@localhost ~]# su - root
    [root@localhost ~]# echo $LD_LIBRARY_PATH
    /orabin/oracle/10.2_client/lib
    [root@localhost ~]#

    Here's my /etc/profile

    # /etc/profile
    # System wide environment and startup programs, for login setup
    # Functions and aliases go in /etc/bashrc
    pathmunge () {
    if ! echo $PATH | /bin/egrep -q "(^|$1($|" ; then
    if [ "$2" = "after" ] ; then
    PATH=$PATH:$1
    else
    PATH=$1:$PATH
    fi
    fi
    }

    # ksh workaround
    if [ -z "$EUID" -a -x /usr/bin/id ]; then
    EUID=`id -u`
    UID=`id -ru`
    fi

    # Path manipulation
    if [ "$EUID" = "0" ]; then
    pathmunge /sbin
    pathmunge /usr/sbin
    pathmunge /usr/local/sbin
    fi

    # No core files by default
    ulimit -S -c 0 > /dev/null 2>&1

    if [ -x /usr/bin/id ]; then
    USER="`id -un`"
    LOGNAME=$USER
    MAIL="/var/spool/mail/$USER"
    fi

    HOSTNAME=`/bin/hostname`
    HISTSIZE=1000

    if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
    INPUTRC=/etc/inputrc
    fi

    export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

    for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
    . $i
    fi
    done

    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

    unset i
    unset pathmunge

    if ! echo ${LD_LIBRARY_PATH} | /bin/fgrep -q "/orabin/oracle/10.2_client/lib"
    then
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/orabin/oracle/10.2_client/lib"
    fi

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

    Post

    Quote Originally Posted by nicki vallentgoed View Post
    If that is so then why do i have to su - root to get it to show my $LD_LIBRARY_PATH values:
    I believe the answers might be this statement,
    if ! echo ${LD_LIBRARY_PATH} | /bin/fgrep -q "/orabin/oracle/10.2_client/lib"
    then
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/orabin/oracle/10.2_client/lib"
    fi
    Instead of whole 'if' part , try this one just comment out three lines
    exclude the assignment.

    # if ! echo ${LD_LIBRARY_PATH} | /bin/fgrep -q "/orabin/oracle 10.2_client/lib"
    #then
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/orabin/oracle/10.2_client/lib"
    #fi
    If commenting out these lines didn't work,then then you will need debug -place echo statements with /etc/profile like echo given below,
    Important take backup of /etc/profile before editing,all the best
    /etc/profile

    # ksh workaround
    if [ -z "$EUID" -a -x /usr/bin/id ]; then
    EUID=`id -u`
    UID=`id -ru`
    fi

    # Path manipulation
    if [ "$EUID" = "0" ]; then
    pathmunge /sbin
    pathmunge /usr/sbin
    pathmunge /usr/local/sbin
    fi

    # No core files by default
    ulimit -S -c 0 > /dev/null 2>&1

    if [ -x /usr/bin/id ]; then
    USER="`id -un`"
    LOGNAME=$USER
    MAIL="/var/spool/mail/$USER"
    fi

    HOSTNAME=`/bin/hostname`
    HISTSIZE=1000

    if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
    INPUTRC=/etc/inputrc
    fi

    export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC

    for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
    . $i
    fi
    done

    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

    unset i
    unset pathmunge


    if ! echo ${LD_LIBRARY_PATH} | /bin/fgrep -q "/orabin/oracle/10.2_client/lib"
    then
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH":/orabin/oracle/10.2_client/lib"
    fi

    echo "Displaying Values..."
    echo $ORACLE_HOME
    echo $JAVA_HOME
    echo $LD_LIBRARY_PATH
    echo $PATH
    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

  4. #14
    Just Joined!
    Join Date
    Sep 2008
    Posts
    10
    HI

    Ok problem solved!!!!

    this is what i tried and it seems to work:

    In my root home created a file called cache_start.sh and cache_stop.sh
    touch cache_start.sh
    touch cache_stop.sh

    in these files i put:
    ccontrol start cache
    and
    ccontrol stop cache quietly
    respectively

    then in my service i put the following:

    start)
    echo -n ""
    echo "Starting cache: "
    su - $CACHE_USR -c "/home/cache_start.sh"
    RETVAL=0
    echo
    [ $RETVAL = 0 ] && touch /var/lock/subsys/cashier
    ;;
    stop)
    echo -n "Stopping cache: "
    su - $CACHE_USR -c "/home/cache_stop.sh"
    RETVAL=0
    echo
    [ $RETVAL = 0 ] && rm -f /var/lock/subsys/cashier
    ;;
    restart)


    And it seems to work, don't ask me why
    I dont need anything special in my /etc/profile

    To LakshmiPathi.G a great big thank you for your patience and help!
    If i new u i would be buying u a beer right now!

  5. #15
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,758
    Quote Originally Posted by nicki vallentgoed View Post
    HI

    Ok problem solved!!!!
    Wow..Really glad to know its finally working

    If i new u i would be buying u a beer right now!
    Yes..surely, But for now v can have few banana's
    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

Page 2 of 2 FirstFirst 1 2

Posting Permissions

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