LinuxQuestions.org
Register a domain and help support LQ
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, 03:33 AM   #1
tiger2000
LQ Newbie
 
Registered: Jul 2009
Posts: 6

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, 03:49 AM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 208Reputation: 208Reputation: 208
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 03:50 AM.
 
Old 07-21-2009, 04:20 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
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, 10:36 PM   #4
tiger2000
LQ Newbie
 
Registered: Jul 2009
Posts: 6

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 09:04 PM
hostname in /var/log/messages avigdorf Linux - Newbie 4 12-06-2007 04:52 AM
where is the file in which i can perm change my hostname hirts123 Mandriva 7 02-05-2005 04:10 PM
hostname in /var/log/messages not printing bkevind Linux - Newbie 4 01-07-2004 09:39 AM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 06:01 PM


All times are GMT -5. The time now is 11:53 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration