You are not logged in.

#1 2008-02-14 00:14:51

New Face In Hell
Member
From: Germany
Registered: 2008-02-13
Posts: 7

Usage of ENV_PATH in /etc/login.defs / Where comes $PATH from?

Hello,

I just installed Arch Linux a few hours ago, at the moment I have got a problem with $PATH.

/etc/login.defs says:

#
# *REQUIRED*  The default PATH settings, for superuser and normal users.
#
# (they are minimal, add the rest in the shell startup files)   <--- minimal?
ENV_SUPATH      PATH=/sbin:/bin:/usr/sbin:/usr/bin
ENV_PATH        PATH=/bin:/usr/bin

, so I expected that PATH is set to (at least) "/sbin:/bin:/usr/sbin:/usr/bin" when I log in as root; but echo $PATH as root (no matter if I start a session with su in X or on the console) gives

/bin:/usr/bin:/usr/bin:/usr/ucb

.

I wonder where this $PATH comes from? What happened to the values set in login.defs?

grepping for PATH in /etc gave no suspicious result.

~/.bashrc:

alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '

Any help appreciated.

Grettings, Florian

Last edited by New Face In Hell (2008-02-14 00:15:41)

Offline

#2 2008-02-14 00:24:45

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: Usage of ENV_PATH in /etc/login.defs / Where comes $PATH from?

/etc/profile?

Offline

#3 2008-02-14 00:30:28

New Face In Hell
Member
From: Germany
Registered: 2008-02-13
Posts: 7

Re: Usage of ENV_PATH in /etc/login.defs / Where comes $PATH from?

Misfit138 wrote:

/etc/profile?

Ah, I have forgotten to mention that.
At the beginning I had no /etc/profile (I don't know why, because all the settings in /etc/profile.d/ are useless then) so I created one.
It looks like this (I've found it here somewhere on the forum):

#
# /etc/profile
#


# load profiles from /etc/profile.d
#  (to disable a profile, just remove execute permission on it)
if [ `ls -A1 /etc/profile.d/ | wc -l` -gt 0 ]; then
        for profile in /etc/profile.d/*.sh; do
                if [ -x $profile ]; then
                    . $profile
                fi
        done
        unset profile
fi

.

I *could* set path in /etc/profile and ~/.bashrc, but what is then with the comment (they are minimal, add the rest in the shell startup files)?

/etc/profile.bash:

#
# /etc/profile.bash
# Global settings for bash shells
#

PS1='[\u@\h \W]\$ '
PS2='> '
PS3='> '
PS4='+ '

export PS1 PS2 PS3 PS4


#In the future we may want to add more ulimit entries here,
# in the offchance that /etc/security/limits.conf is skipped
ulimit -Sc 0 #Don't create core files

if test "$TERM" = "xterm" -o \
        "$TERM" = "xterm-color" -o \
        "$TERM" = "xterm-256color" -o \
        "$TERM" = "rxvt" -o \
        "$TERM" = "rxvt-unicode" -o \
        "$TERM" = "xterm-xfree86"; then
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
    export PROMPT_COMMAND
fi

Last edited by New Face In Hell (2008-02-14 00:31:12)

Offline

#4 2008-02-14 00:39:04

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: Usage of ENV_PATH in /etc/login.defs / Where comes $PATH from?

Here's mine, feel free to use this, but something tells me that if etc/profile didn't get created, then something went awry during your install, and it might not be the only problem...unless something has changed in the installer that I don't know about.

#
# /etc/profile
#

export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/opt/bin"
export MOZ_DISABLE_PANGO=1
export MANPATH="/usr/man:/usr/X11R6/man"
export LESSCHARSET="latin1"
export INPUTRC="/etc/inputrc"
export LESS="-R"

export LC_COLLATE="C"

export COLUMNS LINES

export PS1='[\u@\h \W]\$ '
export PS2='> '

umask 022

if [ "$TERM" = "xterm" -o "$TERM" = "xterm-color" -o "$TERM" = "rxvt" -o "$TERM" = "xterm-xfree86" ]; then
  PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
fi

# load profiles from /etc/profile.d
#  (to disable a profile, just remove execute permission on it)
if [ `ls -A1 /etc/profile.d/ | wc -l` -gt 0 ]; then
  for profile in /etc/profile.d/*.sh; do
    if [ -x $profile ]; then
      . $profile
    fi
  done
  unset profile
fi
alias yogurt="yaourt"
# End of file

The shell startup files reside under /etc/rc.d fwiw.

Offline

#5 2008-02-14 00:57:44

New Face In Hell
Member
From: Germany
Registered: 2008-02-13
Posts: 7

Re: Usage of ENV_PATH in /etc/login.defs / Where comes $PATH from?

Thank you for your /etc/profile.

Misfit138 wrote:

Here's mine, feel free to use this, but something tells me that if etc/profile didn't get created, then something went awry during your install, and it might not be the only problem...unless something has changed in the installer that I don't know about.

I wounder about that, too... at least every other thing works like expected. The installation finished also with no errors (IMO, this was not my first Linux installation).

Offline

#6 2008-02-14 01:49:28

New Face In Hell
Member
From: Germany
Registered: 2008-02-13
Posts: 7

Re: Usage of ENV_PATH in /etc/login.defs / Where comes $PATH from?

For completion: the above mentioned $PATH comes from xdm (it is set via DisplayManager.DISPLAY.systemPath).

Offline

Board footer

Powered by FluxBB