Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/etc/profile removes /usr/games/bin from $PATH
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
aminalshmu
Tux's lil' helper
Tux's lil' helper


Joined: 13 Sep 2004
Posts: 78
Location: TX, USA

PostPosted: Fri May 01, 2009 3:31 pm    Post subject: /etc/profile removes /usr/games/bin from $PATH Reply with quote

Code:
# THIS FILE IS AUTOMATICALLY GENERATED BY env-update.
# DO NOT EDIT THIS FILE. CHANGES TO STARTUP PROFILES
# GO INTO /etc/profile NOT /etc/profile.env

export CG_COMPILER_EXE='/opt/bin/cgc'
export CONFIG_PROTECT='/usr/share/config /usr/kde/3.5/share/config /usr/kde/3.5/env /usr/kde/3.5/shutdown'
export CONFIG_PROTECT_MASK='/etc/gentoo-release /etc/sandbox.d /etc/env.d/java/ /etc/udev/rules.d /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/ca-certificates.conf /etc/revdep-rebuild /etc/splash'
export CVS_RSH='ssh'
export FLTK_DOCDIR='/usr/share/doc/fltk-1.1.9/html'
export GCC_SPECS=''
export GDK_USE_XFT='1'
export HG='/usr/bin/hg'
export INFOPATH='/usr/share/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.19.1/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.3/info'
export KDE_IS_PRELINKED='1'
export LADSPA_PATH='/usr/lib64/ladspa'
export LESS='-R -M --shift 5'
export LESSOPEN='|lesspipe.sh %s'
export MANPATH='/usr/local/share/man:/usr/share/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.19.1/man:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.3.3/man:/etc/java-config/system-vm/man/:/usr/kde/3.5/share/man:/usr/qt/3/doc/man:/opt/nvidia-cg-toolkit/man'
export OPENGL_PROFILE='nvidia'
export PATH='/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.3:/usr/kde/3.5/bin:/usr/qt/3/bin:/usr/games/bin'
export PKG_CONFIG_PATH='/usr/qt/3/lib64/pkgconfig'
export PRELINK_PATH_MASK='/usr/lib64/klibc'
export QMAKESPEC='linux-g++'
export QTDIR='/usr/qt/3'
export ROOTPATH='/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.3.3:/usr/kde/3.5/sbin:/usr/kde/3.5/bin:/usr/qt/3/bin'
export SANE_CONFIG_DIR='/etc/sane.d'
export USB_DEVFS_PATH='/dev/bus/usb'
export XDG_CONFIG_DIRS='/etc/xdg'
export XDG_DATA_DIRS='/usr/local/share:/usr/share:/usr/kde/3.5/share'
Code:
# /etc/profile: login shell setup
#                                 
# That this file is used by any Bourne-shell derivative to setup the
# environment for login shells.                                     
#                                                                   

# Load environment settings from profile.env, which is created by
# env-update from the files in /etc/env.d
if [ -e /etc/profile.env ] ; then
        . /etc/profile.env
fi
export EDITOR=${EDITOR:-/bin/nano}
export PAGER=${PAGER:-/usr/bin/less}

# 077 would be more secure, but 022 is generally quite realistic
umask 022

# Set up PATH depending on whether we're root or a normal user.
# There's no real reason to exclude sbin paths from the normal user,
# but it can make tab-completion easier when they aren't in the
# user's PATH to pollute the executable namespace.
#
# It is intentional in the following line to use || instead of -o.
# This way the evaluation can be short-circuited and calling whoami is
# avoided.

# commented because i want all my commands for sudo!

# if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
#       PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
# else
#       PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
# fi

        PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"

export PATH
unset ROOTPATH

if [ -n "${BASH_VERSION}" ] ; then
        # Newer bash ebuilds include /etc/bash/bashrc which will setup PS1
        # including color.  We leave out color here because not all
        # terminals support it.
        if [ -f /etc/bash/bashrc ] ; then
                # Bash login shells run only /etc/profile
                # Bash non-login shells run only /etc/bash/bashrc
                # Since we want to run /etc/bash/bashrc regardless, we source it
                # from here.  It is unfortunate that there is no way to do
                # this *after* the user's .bash_profile runs (without putting
                # it in the user's dot-files), but it shouldn't make any
                # difference.
                . /etc/bash/bashrc
        else
                PS1='\u@\h \w \$ '
        fi
else
        # Setup a bland default prompt.  Since this prompt should be useable
        # on color and non-color terminals, as well as shells that don't
        # understand sequences such as \h, don't put anything special in it.
        PS1="${USER:-$(type whoami >/dev/null && whoami)}@$(type uname >/dev/null && uname -n) \$ "
fi

for sh in /etc/profile.d/*.sh ; do
        [ -r "$sh" ] && . "$sh"
done
unset sh
Code:
jordan@jordan ~ $ sudo emerge -pv baselayout

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] sys-apps/baselayout-2.0.0  USE="-build" 0 kB
Code:
jordan@jordan ~ $ groups
tty lp wheel audio cdrom video games usb users lpadmin portage jordan plugdev


there must be a better solution for setting $PATH... currently I'm just appending "/usr/games/bin:" to the PATH line in /etc/profile, but this is not ideal as it puts /usr/games/bin in root's path also. I tried putting
Code:
export PATH="$PATH:/usr/games/bin"

in ~/.bashrc or ~/.bash_profile but then emerge and other commands don't have bash-completion enabled through sudo. what's going on here? shouldn't baselayout leave /usr/games/bin in the path after being set up by env-update?
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Fri May 01, 2009 10:14 pm    Post subject: Reply with quote

I think you modified your /etc/profile, because on a fresh install, here is how mine looks like (part of it):
Code:
if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
        PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
else
        PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
fi
export PATH


EDIT:
Quote:
# commented because i want all my commands for sudo!

# if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
# PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
# else
# PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
# fi

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"


Replace ROOTPATH with PATH, and it should be enough
_________________
The End of the Internet!
Back to top
View user's profile Send private message
truc
Advocate
Advocate


Joined: 25 Jul 2005
Posts: 3199

PostPosted: Wed Jun 03, 2009 10:07 am    Post subject: Reply with quote

SOLVED?
_________________
The End of the Internet!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum