[SOLVED] quirky behavour for hostname
Hi
I have no idea if this relates to smxi 1) If I open a terminal my local user no longer sees my true hostname instead :: Code :: gordy@unknown002197762dda:~$ 2) ditto open root terminal 3) In root if I run :: Code :: /etc/init.d/hostname.sh
root@unknown002197762dda:/home/gordy# hostname sid 4) in looking at my rsyslog I sometimes get sid and other times that horrible string. 5) I use logrotate and older logs are showing the same string 6) I run rootkit hunter and am happy its not an intrusion issue 7) Currently running nouveau altho I am normally a closed nvidia user and I currenly use Damentz's kernel 686 kernel. any clues on what is going on? 8) I did recently change my ps/2 mouse to an usb mouse but have no other hardware changes. < Edited by aus9 :: Oct 6, 11, 4:35 > Back to top |
ok I just restored an august partimage IMAGE that has Nvidia, Damentz stuff and of course no updates.
But its not the new usb mouse....my hostname on this image is good and rsyslog is good. Another thing I forgot to mention in above post is....at time I did first post ...my syslog showed correct hostname and terminal did not and on a another bootup on first post....the syslog had the wrong hostname from the start of its log thru to reboot/shutdown hmm Back to top |
in inxi, I remember removing hostname, let me check.
Ok, checked. Basically hostname is now a global, $HOSTNAME if you do: echo $HOSTNAME it should show the hostname. There is also the command hostname, which of course is just: echo $HOSTNAME more or less, so the first thing to check is echoing HOSTNAME. Back to top |
ok I am back on latest image.
:: Code :: echo $HOSTNAME
unknown002197762dda root@unknown002197762dda:/# hostname unknown002197762dda 2) The next bit has me stumped ok this is a fragment of my /var/log/messages :: Code :: Oct 2 10:17:11 unknown002197762dda kernel: Kernel logging (proc) stopped.
Oct 2 10:17:11 unknown002197762dda rsyslogd: [origin software="rsyslogd" swVersion="5.8.5" x-pid="1542" x-info="http://www.rsyslog.com"] exiting on signal 15. Oct 5 07:03:21 sid kernel: imklog 5.8.5, log source = /proc/kmsg started. Oct 5 07:03:21 sid rsyslogd: [origin software="rsyslogd" swVersion="5.8.5" x-pid="1491" x-info="http://www.rsyslog.com"] start Oct 5 07:03:21 sid kernel: Linux version 3.0.0-4.dmz.2-liquorix-686 (Debian 3.0.0-8) (damentz@gmail.com) (gcc version 4.6.1 (Debian 4.6.1-9) ) #1 ZEN SMP PREEMPT Tue Sep 6 07:29:10 UTC 2011 Oct 5 07:03:21 sid kernel: BIOS-provided physical RAM map: the last line of that file is Oct 5 07:04:51 sid kernel: exe (2201): /proc/2201/oom_adj is deprecated, please use /proc/2201/oom_score_adj instead. and local is about 7:07 as I type this. so why is today's hostname wrong but today's 'syslog" stuff so right? BTW I am showing a fragment of oct 2 to show the wrong hostname occurred on oct 2 and that is when I took the image but stupid me...I did not think to look at the log at that time.....just after doing smxi 3) While struggling to comprehend this...I decided to install HARDINFO on the old image and have just installed it here on this current latest image Of interest to me is this extra quirk...found in the report Operating System Version Kernel Linux 3.0.0-4.dmz.2-liquorix-686 (i686) Compiled #1 ZEN SMP PREEMPT Tue Sep 6 07:29:10 UTC 2011 C Library Unknown Default C Compiler GNU C Compiler version 4.6.1 (Debian 4.6.1-13) Distribution Debian GNU/Linux wheezy/sid Current Session Computer Name unknown002197762dda User Name gordy (gordy) Home Directory /home/gordy Desktop Environment XFCE 4 Ok so I did a search in the deb package search tool for glibc my installed hit is only linux-libc-dev Not installed does not show a filename match hmmm Back to top |
check the file: /etc/hostname
remember that hostname is really a very simple thing, the file has it, $HOSTNAME loads that from reading that file, and the command 'hostname' I believe is simply 'echo $HOSTNAME' So you're not really talking about anything complicated. I am fairly certain that the system on boot reads /etc/hostname, puts it into the global, and that's it. sleep/wake will not reread it, only a reboot will if I remember right, though there's probably some way to make linux check it again without a reboot but I never found one. Back to top |
/etc/hostname has not changed from original setting of
sid any other ideas? /etc/rcS.d/S07hostname.sh is supposed to call for that init.d script I did in my first post. (AFAIK) 2) according to the S07 file....it looks like its supposed to echo into a log? Setting hostname to $HOSTNAME but I can't see that in any log. holding control/alt and F1 gives me only the last messages of boot Maybe I should increase the logging? 3) Anyhow the S07 file kinda works manually as well :: Code :: /etc/rcS.d/S07hostname.sh
root@unknown002197762dda:/var/log# hostname sid Back to top |
ok
what I think is probably wrong but here goes I think that there is some kind of breakdown in the init scripts. Otherwise how can I explain this? :: Code :: hostname
unknown002197762dda gordy@unknown002197762dda:~$ cat /etc/hostname sid what I mean is....my hostname is set.....running the init script manually works but some how the init scripts at boot up are not. so lets eliminate the permissions? :: Code :: ls -al /etc/hostname
-rw-r--r-- 1 root root 4 Jun 15 19:49 /etc/hostname and for /etc/init.d -rwxr-xr-x 1 root root 1423 Jan 1 2011 hostname.sh and for /etc/rcS.d lrwxrwxrwx 1 root root 21 Jun 15 19:50 S07hostname.sh -> ../init.d/hostname.sh 2) the reason why I mentioned the new usb mouse was I thought maybe the new hardware...and USB might have settling issues which might fail my init script.....but I think I can eliminate that but still stumped. I appreciate you think its simple but my brain is scambled at the moment and am not seeing it .....heh heh Back to top |
oh, no, with your new data I agree, there's no problem with scrambled brains, it is complicated, you're doing a good job tracking it down too, impressive.
So you think, or it looks like, something is going wrong with the initscripts, making them puke and die, thus making the hostname initscript not fire? Excellent delving into the problem, I now know more than 2x than I did about hostname mere hours ago. It could be the usb mouse, something is kicking linux on boot to make it fail to do things I didn't know it could fail to do. Looks like this hostname thing is just a symptom of a more serious issue. My guess would be that when hostname.sh fails to fire, there's some weird kernel level default you're seeing that should normally never be seen by human eyes. I had to reread all your posts, and now see that I was off here by quite a bit, I excuse myself because I've been suffering a head cold for a few weeks, you were being pretty clear here. So what you're looking for is something jarring the boot, maybe a kernel error that is logged somewhere earlier, prior to that init script running? with such odd errors, I get tempted to resort to my fallback advice, do a full hard disk scan, using a hard disk testing utility on a livecd, not just chkdsk. Also do a ram scan. It's possible something is getting corrupted on boot, and that could be ram or disk. Odd. Back to top |
I will do so tonight after work or maybe Fri
in the meantime, I can eliminate Damentz's kernel as I changed to Debian's last night and problem remains. 2) Looking at the messages at bootup....I can't see anything funny 3) I have not yet run xxdiff against good or bad /var/log/messages and I don;t think that will work as one syslog has the right hostname and yet the terminal does not. 4) Until your suggestion I was thinking of using root powers to disable lots of init scripts to see if "one or more" of them was falling over and stopping hostname working. 5) I don't think its the mouse as the mouse and old image worked ok but I will retest by leaving the mouse disconnected at boot...to be sure 6) How do I do a ram scan? Back to top |
Get the ultimate boot cd (UBCD) to start, everyone should have that anyway.
Hiren's boot cd also has a lot of utilities, though it's harder to find. Parted magic has some utilities as well. All 3 should be in anyone's basic toolkit no matter what, though hiren's has declined quite a bit over the years from what I can see. Back to top |
All times are GMT - 8 Hours |