LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-21-2009, 02:33 AM   #1
tiger2000
LQ Newbie
 
Registered: Jul 2009
Posts: 7

Rep: Reputation: 0
after hostname change, syslogd still output previous hostname to messages file


Dear All,

We're running two servers : CentOS 4.4 and RedHat ent. 5.1, both of them have same issues :

after we change to another hostname, the syslog (/var/log/messages) still keeps the previous hostname.

the way we're change hostname are :
/etc/hosts
/etc/sysconfig/network
service network restart
(actually, we've reboot this server several times)

but we still found the log messages are still in previous hostname. (in /var/log/messages)

any advice on this? Thanks.
 
Old 07-21-2009, 02:49 AM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
Code:
root@salmon:~#echo "foo" > /etc/hostname 
root@salmon:~#hostname
foo
root@salmon:~#echo "bar" > /etc/hostname 
root@salmon:~#hostname
bar

Last edited by jhwilliams; 07-21-2009 at 02:50 AM.
 
Old 07-21-2009, 03:20 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by tiger2000 View Post
the way we're change hostname are :
/etc/hosts
/etc/sysconfig/network
service network restart
(actually, we've reboot this server several times)

but we still found the log messages are still in previous hostname. (in /var/log/messages)

any advice on this? Thanks.
I hope you're not expecting historical lines in the
logs to change the hostname entry? That won't happen.



Cheers,
Tink
 
Old 07-22-2009, 09:36 PM   #4
tiger2000
LQ Newbie
 
Registered: Jul 2009
Posts: 7

Original Poster
Rep: Reputation: 0
I've fingure out the reason, and it looks like I should take this action before 'service syslog restart' .

echo "my.new.host.name" > /proc/sys/kernel/hostname

there's `hostname my.new.host.name` command seems doing the same thing.

Thanks.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
logwatch report by hostname for syslogd server yip623 Linux - Server 1 08-07-2008 08:04 PM
hostname in /var/log/messages avigdorf Linux - Newbie 4 12-06-2007 03:52 AM
where is the file in which i can perm change my hostname hirts123 Mandriva 7 02-05-2005 03:10 PM
hostname in /var/log/messages not printing bkevind Linux - Newbie 4 01-07-2004 08:39 AM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 05:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:36 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