View previous topic :: View next topic |
Author |
Message |
Fulgurance Veteran
Joined: 15 Feb 2017 Posts: 1200
|
Posted: Thu Mar 23, 2017 9:21 am Post subject: [Résolu] Problème avec la variable PS1 |
|
|
Bonjour, voilà, après avoir fini finalement mon installation de Gentoo ainsi que de Plasma, je me suis rendu compte d'un petit bug (ou erreur de configuration, je ne sais pas ...)
Quand je suis sur la console, mon PS1 m'affiche livecd ??? Alors que je ne suis pas du tout sur un liveCD !!!
Et j'ai regardé mon fichier /etc/profile, normalement ça affiche le hostname, et mon fichier hostname normalement contient "MSI-GS73VR-6RF", mais pas le nom "livecd"...
Sauriez-vous pourquoi ça m'affiche ça ?
Last edited by Fulgurance on Mon Mar 27, 2017 10:01 pm; edited 1 time in total |
|
Back to top |
|
|
Syl20 l33t
Joined: 04 Aug 2005 Posts: 619 Location: France
|
Posted: Thu Mar 23, 2017 10:14 am Post subject: |
|
|
Il y a plusieurs scripts à vérifier :
- ~/.profile
- ~/.bashrc
- /etc/profile
- /etc/profile.d/*
- /etc/bash* (je n'ai pas tous les fichiers/répertoires en tête)
- /etc/env.d/*
- et peut-être d'autres...
Pour faire simple, si tu ne trouves rien dans ton répertoire personnel :
Code: | # grep -r PS1 /etc/ |
En parallèle, es-tu sûr du nom de ta machine ? Le fichier /etc/conf.d/hostname n'est (normalement) utilisé qu'au démarrage, par le service du même nom (s'il est actif, évidemment).
|
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8708 Location: ~Brussels - Belgique
|
Posted: Thu Mar 23, 2017 1:19 pm Post subject: |
|
|
Ton système a-t-il redémarré ou es-tu encore en "chroot" ? _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
Fulgurance Veteran
Joined: 15 Feb 2017 Posts: 1200
|
Posted: Thu Mar 23, 2017 2:43 pm Post subject: |
|
|
Non, comme je l'ai déjà mentionné au début, je n'ai même pas de clé USB d'inséré, j'ai déjà redémarré depuis 2 jours et je suis sur ma gentoo de mon PC, ça c'est certain mdr.
Je vais du coup vérifié les fichiers que tu m'as linké Syl20 |
|
Back to top |
|
|
Fulgurance Veteran
Joined: 15 Feb 2017 Posts: 1200
|
Posted: Thu Mar 23, 2017 2:48 pm Post subject: |
|
|
Tiens pour que tu regardes:
Code: | grep -r PS1 /etc/
/etc/bash/bashrc: PS1='\[\033]0;\u@\h:\w\007\]'
/etc/bash/bashrc: PS1='\[\033k\u@\h:\w\033\\\]'
/etc/bash/bashrc: unset PS1
/etc/bash/bashrc:# Set colorful PS1 only on colorful terminals.
/etc/bash/bashrc: PS1+='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
/etc/bash/bashrc: PS1+='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
/etc/bash/bashrc: PS1+='\u@\h \W \$ '
/etc/bash/bashrc: PS1+='\u@\h \w \$ '
Fichier binaire /etc/udev/hwdb.bin correspondant
/etc/profile: # Newer bash ebuilds include /etc/bash/bashrc which will setup PS1
/etc/profile: PS1='\u@\h \w \$ '
/etc/profile: PS1="${USER:-$(whoami 2>/dev/null)}@$(uname -n 2>/dev/null) \$ "
|
Le contenu de mon fichier /etc/conf.d/hostname:
Code: | # Set to the hostname of this machine
hostname="MSI-GS73VR-6RF" |
|
|
Back to top |
|
|
Syl20 l33t
Joined: 04 Aug 2005 Posts: 619 Location: France
|
Posted: Thu Mar 23, 2017 3:09 pm Post subject: |
|
|
Fulgurance wrote: | Tiens pour que tu regardes: |
Un coup dans l'eau. Rien de bizarre là-dedans.
Quote: | Le contenu de mon fichier /etc/conf.d/hostname: |
C'est bon. Mais est-ce que la commande "hostname" te renvoie bien la bonne valeur ? |
|
Back to top |
|
|
Fulgurance Veteran
Joined: 15 Feb 2017 Posts: 1200
|
Posted: Thu Mar 23, 2017 3:23 pm Post subject: |
|
|
Non, la commande me renvoie "livecd" ...
J'ai regardé au fait en faisant rc-update, le service hostname est bien activé ... je ne comprend pas là... |
|
Back to top |
|
|
guitou Guru
Joined: 02 Oct 2003 Posts: 534 Location: France
|
Posted: Fri Mar 24, 2017 1:14 pm Post subject: |
|
|
Hello.
A tout hasard, ce serait pas dans le fichier /etc/hosts?.. (voire tout simplement /etc/hostname)
Et sinon, au pire, un petit "grep -r livecd /etc" dans devrait permettre d'identifier la source du probleme.
++
Gi) |
|
Back to top |
|
|
Fulgurance Veteran
Joined: 15 Feb 2017 Posts: 1200
|
Posted: Fri Mar 24, 2017 8:12 pm Post subject: |
|
|
Le fichier /etc/hosts ? Je te le link mais je ne pense pas, il sert pour la connexion au réseau, là je suis juste sur mon terminal :
Code: | # /etc/hosts: Local Host Database
#
# This file describes a number of aliases-to-address mappings for the for
# local hosts that share this file.
#
# The format of lines in this file is:
#
# IP_ADDRESS canonical_hostname [aliases...]
#
#The fields can be separated by any number of spaces or tabs.
#
# In the presence of the domain name service or NIS, this file may not be
# consulted at all; see /etc/host.conf for the resolution order.
#
# IPv4 and IPv6 localhost aliases
127.0.0.1 localhost
::1 localhost
#
# Imaginary network.
#10.0.0.2 myname
#10.0.0.3 myfriend
#
# According to RFC 1918, you can use the following IP networks for private
# nets which will never be connected to the Internet:
#
# 10.0.0.0 - 10.255.255.255
# 172.16.0.0 - 172.31.255.255
# 192.168.0.0 - 192.168.255.255
#
# In case you want to be able to connect directly to the Internet (i.e. not
# behind a NAT, ADSL router, etc...), you need real official assigned
# numbers. Do not try to invent your own network numbers but instead get one
# from your network provider (if any) or from your regional registry (ARIN,
# APNIC, LACNIC, RIPE NCC, or AfriNIC.)
#
|
Par contre, pour le fichier /etc/hostname, ce n'est juste pas possible puisqu'il n'existe pas sous openrc, c'est le fichier /etc/cond.d/hostname, je l'ai déjà linké d'ailleurs.
Sinon je te donne le retour de la commande grep -r livecd /etc :
Code: | grep -r livecd /etc
grep: /etc/gshadow-: Permission non accordée
grep: /etc/group-: Permission non accordée
grep: /etc/.pwd.lock: Permission non accordée
grep: /etc/cron.monthly: Permission non accordée
grep: /etc/shadow: Permission non accordée
grep: /etc/gshadow: Permission non accordée
grep: /etc/shadow-: Permission non accordée
grep: /etc/NetworkManager/system-connections/.keep_net-misc_networkmanager-0: Permission non accordée
grep: /etc/ssl/private: Permission non accordée
grep: /etc/default/useradd: Permission non accordée
grep: /etc/skel/.ssh: Permission non accordée
grep: /etc/ssh/sshd_config: Permission non accordée
grep: /etc/passwd-: Permission non accordée
grep: /etc/cups/cups-files.conf: Permission non accordée
grep: /etc/cups/snmp.conf.default: Permission non accordée
grep: /etc/cups/cupsd.conf: Permission non accordée
grep: /etc/cups/snmp.conf: Permission non accordée
grep: /etc/cups/cups-files.conf.default: Permission non accordée
grep: /etc/ppp/pap-secrets.example: Permission non accordée
grep: /etc/ppp/pap-secrets: Permission non accordée
grep: /etc/ppp/chap-secrets: Permission non accordée
grep: /etc/ppp/chap-secrets.example: Permission non accordée
grep: /etc/polkit-1/localauthority: Permission non accordée
grep: /etc/polkit-1/rules.d: Permission non accordée
grep: /etc/cron.hourly: Permission non accordée |
Ce qui est bizarre, c'est que si je lance cette commande en ayant fait au préalable la commande su, ça ne retourne rien, et si je le fais en utilisateur normal, ça retourne ce que je viens de te linker.... Donc peut-être un problème de droit alors ? |
|
Back to top |
|
|
Oupsman Veteran
Joined: 19 Jul 2004 Posts: 1042
|
Posted: Sat Mar 25, 2017 8:14 am Post subject: |
|
|
Si cela ne te retourne rien en étant root (j'imagine que tu utilises cette commande su pour cela), c'est justement que tu as les droits pour regarder tous les fichiers.
Quand tu regardes le résultat de ta commande grep, il te dit "permission non accordée"
Le message est assez clair selon moi.
Peux-tu taper la commande grep livecd ~/.bash_profile ?
Il ne me semble pas que ce fichier t'ait été suggéré depuis le début du thread. _________________ --
L'idéal de nouveauté semble avoir remplacé l'idéal de progrès. C'est bien triste.
----
Unix philosophy: "Do one thing and do it well."
systemd: "Try to do everything and do it wrong." |
|
Back to top |
|
|
Fulgurance Veteran
Joined: 15 Feb 2017 Posts: 1200
|
Posted: Sat Mar 25, 2017 8:22 am Post subject: |
|
|
Oui c'était avec su.
La ta commande en utilisateur normal ou en root, ça ne me retourne rien. |
|
Back to top |
|
|
sebB l33t
Joined: 02 Mar 2011 Posts: 806 Location: S.O. France
|
Posted: Sat Mar 25, 2017 9:01 am Post subject: |
|
|
Peux tu tester en rajoutant MSI-GS73VR-6RF dans ton /etc/hosts
Code: | 127.0.0.1 localhost MSI-GS73VR-6RF |
Sinon ca donne quoi
Code: | hostname -s
hostname -a
hostname -f |
|
|
Back to top |
|
|
Fulgurance Veteran
Joined: 15 Feb 2017 Posts: 1200
|
Posted: Sat Mar 25, 2017 11:54 am Post subject: |
|
|
Alors j'ai modifié le fichier /etc/hosts.
Sinon hostname -s et hostname -f renvoie tous les deux livecd, par contre hostname -a ne renvoie que du vide (rien). |
|
Back to top |
|
|
Fulgurance Veteran
Joined: 15 Feb 2017 Posts: 1200
|
Posted: Mon Mar 27, 2017 10:58 am Post subject: |
|
|
Que dois-je faire du coup ? |
|
Back to top |
|
|
netfab Veteran
Joined: 03 Mar 2005 Posts: 1897 Location: 127.0.0.1
|
Posted: Mon Mar 27, 2017 4:28 pm Post subject: |
|
|
Salut,
En root, que donne :
Code: |
# rc-update | grep hostname
|
Essaie de réinstaller le paquet net-tools :
Code: |
# emerge -av1 net-tools
|
(sujet similaire datant de neuf ans) |
|
Back to top |
|
|
Fulgurance Veteran
Joined: 15 Feb 2017 Posts: 1200
|
Posted: Mon Mar 27, 2017 10:01 pm Post subject: |
|
|
Ah merci beaucoup, tu as résolu mon problème ! |
|
Back to top |
|
|
|