LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-27-2012, 05:16 AM   #1
Luminaro
LQ Newbie
 
Registered: Oct 2012
Location: Vienna Austria
Distribution: DEBIAN, freescale BSP
Posts: 6

Rep: Reputation: Disabled
debian shell prompt does not reflect changed hostname


When I change the hostname in /etc/hostname and reeboot the machine, the shell prompt still shows the old hostname.

Command hostname shows the correct, newly set name.

Shell prompt is defined as:
PS1 = ${debian_chroot:+($debian_chroot)}\u@\h:\w\$

I have already checked /etc/init.d/hostname.sh, tried it manually with start parameter, and it correctly echoed the new name.

So, the value of \h in PS1 seems to be resolved from somewhere else - any ideas?

Thanks!
 
Old 10-27-2012, 06:31 AM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
I don't know what exactly is the problem. But changing the host name is routine in Debian. In /etc grep for the old host name. This should turn up 4 files. Probably less in your case because you already commenced the change. Anyway, edit all the files that you find replacing the host name.

I did this in Squeeze most recently. Will do this week in Wheezy. Maybe there is something moved to a subdir in the conf.d style which becomes more current.

Try the grep first and please reort back.

jlinkels
 
1 members found this post helpful.
Old 10-27-2012, 09:22 AM   #3
Luminaro
LQ Newbie
 
Registered: Oct 2012
Location: Vienna Austria
Distribution: DEBIAN, freescale BSP
Posts: 6

Original Poster
Rep: Reputation: Disabled
grep 'newname' /etc/* returns one file: /etc/hostname

grep 'oldname' /etc/* does NOT return any file, still the prompt says root@oldname, also -R option did not find any relevant files

Thanks, Luminaro

PS: just realized that I had found earlier the oldname in the /etc/hosts file, last line, own IP. Changing this entry did not have any effect. It explains though that the hosts file did not come up with grep.

Last edited by Luminaro; 10-27-2012 at 10:42 AM.
 
Old 10-27-2012, 04:15 PM   #4
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Strange, that never happened to me before. Something must be different and non-vanilla in that Debian installation.

Check this where about every possibility of wrong prompts is described: http://unix.stackexchange.com/questi...ompt-unchanged. And I am out of ideas, sorry.

jlinkels
 
1 members found this post helpful.
Old 10-27-2012, 04:56 PM   #5
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
http://adminuser.wordpress.com/2008/...ian-or-ubuntu/
 
Old 10-28-2012, 04:25 AM   #6
Luminaro
LQ Newbie
 
Registered: Oct 2012
Location: Vienna Austria
Distribution: DEBIAN, freescale BSP
Posts: 6

Original Poster
Rep: Reputation: Disabled
jlinkels: thanks for the link, the only new point was a possible interference of DHCP which (as far as I can tell) is not active on this host. Also out of ideas for now. Will leave this open and document the solution as soon as any comes up.
 
  


Reply

Tags
debian, hostname



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash shell prompt show incorrect hostname. hari85 Linux - Newbie 3 06-22-2010 04:10 AM
passing parameters from a unix shell prompt into a windows cmd.exe prompt nano2 Programming 1 09-01-2009 11:26 AM
Changed hostname during install, now CUPS has wrong hostname on web interface slinx Linux - Software 1 08-07-2009 08:01 PM
$SHELL does not reflect current shell student04 Solaris / OpenSolaris 4 06-10-2008 01:22 PM
Hostname was changed on the command prompt pretty.tulip Linux - Newbie 1 04-02-2006 11:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration