[BASH] problème de chemin (résolu)
Publié : lun. 12 oct. 2009, 16:24
Bonjour,
je soumet à vos lumières un petit soucis, plus irritant que grave...
quand j'utilise Gnome-terminal, tout fonctionne normalement, que ce soit en simple-user ou en root (via "su"); en revanche, si j'ouvre Gnome-terminal directement en superutilisateur ("applications"-->"accessoires"-->"terminal administrateur"), je suis obligé de taper toutes les commandes avec le chemin complet pour que ça marche, et uniquement pour les exécutables se trouvant dans /sbin; par exemple:
alors que...
(là ça marche)
mon /etc/profile:
(la variable PATH semble correcte)
mon /etc/profile.bash:
à priori, /root ne contient pas de profile personnalisé...
et le .bashrc de mon utilisateur semble OK:
je pense donc que c'est plus lié à la façon de lancer le terminal (en simple user, ou avec Gksu), mais dans ce cas, je vois pas où chercher, et je n'ai pas trouvé de réponse sur le web (wikis et forums Arch, Google...).
si quelqu'un voit où chercher, je le remercie d'avance...
je soumet à vos lumières un petit soucis, plus irritant que grave...
quand j'utilise Gnome-terminal, tout fonctionne normalement, que ce soit en simple-user ou en root (via "su"); en revanche, si j'ouvre Gnome-terminal directement en superutilisateur ("applications"-->"accessoires"-->"terminal administrateur"), je suis obligé de taper toutes les commandes avec le chemin complet pour que ça marche, et uniquement pour les exécutables se trouvant dans /sbin; par exemple:
Code : Tout sélectionner
[root@phobos ~]# modprobe coretemp
bash: modprobe: command not found
Code : Tout sélectionner
[root@phobos ~]# /sbin/modprobe coretemp
[root@phobos ~]#
mon /etc/profile:
Code : Tout sélectionner
#Determine our shell without using $SHELL, which may lie
shell="sh"
if test -f /proc/mounts; then
case $(/bin/ls -l /proc/$$/exe) in
*bash) shell=bash ;;
*dash) shell=dash ;;
*ash) shell=ash ;;
*ksh) shell=ksh ;;
*zsh) shell=zsh ;;
esac
fi
# Load shell specific profile settings
test -f "/etc/profile.$shell" && . "/etc/profile.$shell"
#Set our umask
umask 022
# Set our default path
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
export PATH
# Export default pkg-config path
PKG_CONFIG_PATH="/usr/lib/pkgconfig"
export PKG_CONFIG_PATH
# Some readline stuff that is fairly common
HISTSIZE=1000
HISTCONTROL="erasedups"
INPUTRC="/etc/inputrc"
LESS="-R"
LC_COLLATE="C"
export HISTSIZE HISTCONTROL INPUTRC LESS LC_COLLATE
# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
for profile in /etc/profile.d/*.sh; do
test -x $profile && . $profile
done
unset profile
fi
# Termcap is outdated, old, and crusty, kill it.
unset TERMCAP
# Man is much better than us at figuring this out
unset MANPATH
mon /etc/profile.bash:
Code : Tout sélectionner
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
Code : Tout sélectionner
[root@phobos ~]# ls -la
total 44
drwxr-x--- 8 root root 4096 Oct 9 12:26 .
drwxr-xr-x 21 root root 4096 Oct 6 16:06 ..
-rw------- 1 root root 5756 Oct 12 15:13 .bash_history
drwxr-xr-x 2 root root 4096 Oct 7 10:42 .cache
drwx------ 3 root root 4096 Oct 6 21:38 .dbus
drwx------ 3 root root 4096 Oct 12 15:13 .gconf
drwx------ 2 root root 4096 Oct 12 01:34 .gconfd
drwx------ 3 root root 4096 Oct 9 12:26 .gnome2
drwx------ 2 root root 4096 Oct 9 12:26 .gnome2_private
-rw------- 1 root root 218 Oct 8 14:01 .recently-used.xbel
Code : Tout sélectionner
# Check for an interactive session
[ -z "$PS1" ] && return
alias ls='ls --color=auto'
PS1='[\u@\h \W]\$ '
export PATH=${PATH}:/opt/android-sdk/tools
si quelqu'un voit où chercher, je le remercie d'avance...