Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
hostname not set
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
wpkzz
n00b
n00b


Joined: 28 Feb 2013
Posts: 22

PostPosted: Thu May 09, 2013 2:17 pm    Post subject: hostname not set Reply with quote

This may seem very dumb, but i cannot set it straight.
I cannot set the hostname.

The file /etc/init.d/hostname has the content it has to have, namely:
Code:

#!/sbin/runscript
# Copyright (c) 2007-2009 Roy Marples <roy@marples.name>
# Released under the 2-clause BSD license.

description="Sets the hostname of the machine."

depend() {
        keyword -prefix -lxc
}

start()
{
        hostname=${hostname-${HOSTNAME-localhost}}
        ebegin "Setting hostname to $hostname"
        hostname "$hostname"
        eend $? "Failed to set the hostname"
}


As well the file /etc/conf.d/hostname :
Code:

# Set to the hostname of this machine
hostname="monstruona"


When the machine is booting up, syslog-ng complains that no hostname is set,
hence, it cannot work. The "issue" greetings shows

Code:

This is (none). <date>


The command hostname also gives me a (none) answer.
But if i give the command
Code:

rc-update add hostname boot

, she tells me that hostname is allready in the boot runlevel.
And the command rc-update show shows absolutely none of it.

I tried deleting and adding it again, to no gain.

Seems like a simple problem, so simple, that it shouldn't be.

Thanks in advance,
Back to top
View user's profile Send private message
jeracho
n00b
n00b


Joined: 09 May 2013
Posts: 16
Location: Virginia

PostPosted: Thu May 09, 2013 3:28 pm    Post subject: Reply with quote

Have you tried running env-update && source /etc/profile?
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 3783

PostPosted: Thu May 09, 2013 5:12 pm    Post subject: Reply with quote

You can try to check manually whether /etc/runlevels/boot/hostname is a symlink to /etc/init.d/hostname
Also, are the permissions of /etc/init.d/hostname correct?
Back to top
View user's profile Send private message
wpkzz
n00b
n00b


Joined: 28 Feb 2013
Posts: 22

PostPosted: Thu May 23, 2013 2:36 pm    Post subject: strange symlink Reply with quote

Okey, yes, I did try the env-update and source profile many times. That is not it.

The symlink thing... I didn't know about that one. If I check with ls -lah the directory /etc/runlevels/boot/
I obtain the following list:

Code:

monstruona boot # ls -lah
total 8.0K
drwxr-xr-x 2 root root 4.0K May  9 20:25 .
drwxr-xr-x 6 root root 4.0K Apr 24 21:21 ..
lrwxrwxrwx 1 root root   21 May  9 20:25 alsasound -> /etc/init.d/alsasound
lrwxrwxrwx 1 root root   20 Apr 24 21:21 bootmisc -> /etc/init.d/bootmisc
lrwxrwxrwx 1 root root   16 Apr 24 21:21 fsck -> /etc/init.d/fsck
lrwxrwxrwx 1 root root   32 May  9 18:56 hostname -> /etc/init.d//etc/init.d/hostname
lrwxrwxrwx 1 root root   19 Apr 24 21:21 hwclock -> /etc/init.d/hwclock
lrwxrwxrwx 1 root root   19 Apr 24 21:21 keymaps -> /etc/init.d/keymaps
lrwxrwxrwx 1 root root   22 Apr 24 21:21 localmount -> /etc/init.d/localmount
lrwxrwxrwx 1 root root   19 Apr 24 21:21 modules -> /etc/init.d/modules
...


I notice two things: the path for the symlinl is differently stated to the rest, and it comes in different colours.
Actually is the only one which is covered in red outline with white letters in my terminal, instead of the usual cyan -> green scheme that the others follow. What is that supposed to mean?
Back to top
View user's profile Send private message
khayyam
Veteran
Veteran


Joined: 07 Jun 2012
Posts: 1537

PostPosted: Thu May 23, 2013 3:18 pm    Post subject: Re: strange symlink Reply with quote

wpkzz wrote:
Code:
lrwxrwxrwx 1 root root   32 May  9 18:56 hostname -> /etc/init.d//etc/init.d/hostname

wpkzz ... I'm not sure what would have caused this but the fix is simple:

Code:
# ln -sf /etc/init.d/hostname /etc/runlevels/boot/hostname

best ... khay
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 3783

PostPosted: Thu May 23, 2013 4:54 pm    Post subject: Re: strange symlink Reply with quote

wpkzz wrote:
Actually is the only one which is covered in red outline with white letters in my terminal, instead of the usual cyan -> green scheme that the others follow. What is that supposed to mean?

It means that it is a dangliing symlink, i.e. not pointing to any file (the path it points to does not exist). As khayyam has noticed, such a link is usually caused by a bug which, however, is now hard to reproduce.
Back to top
View user's profile Send private message
wpkzz
n00b
n00b


Joined: 28 Feb 2013
Posts: 22

PostPosted: Sun May 26, 2013 2:20 am    Post subject: Bigger issue... Reply with quote

Hi crew:

I am just discovering that this seems to be part of a bigger issue. dbus-daemon is also not starting, and other
services are also messed up. I'll check the details and get back to you if I manage to do something usefull.

Thanks!
Back to top
View user's profile Send private message
wpkzz
n00b
n00b


Joined: 28 Feb 2013
Posts: 22

PostPosted: Fri Jun 07, 2013 2:47 am    Post subject: Reply with quote

Well, this sure is annoying... I have looked everything, read all rc man pages, and even changed the kernel with no avail. Not only hostname doesn't start, but net.*, wicd, wpa_supplicant, etc. Its like rc is not even there. Everything has to be done manually.
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 3783

PostPosted: Fri Jun 07, 2013 5:52 pm    Post subject: Reply with quote

You might reemerge openrc, but before I would check with
Code:
qcheck openrc

what is going on. Perhaps a filesystem corruption broke half of your system.
Code:
qcheck -a
might be appropriate.
Back to top
View user's profile Send private message
wpkzz
n00b
n00b


Joined: 28 Feb 2013
Posts: 22

PostPosted: Fri Jun 07, 2013 8:17 pm    Post subject: Well 'tis is fishy... Reply with quote

I had reemerged openrc a few days ago and it didn't solve the problem. I read on an external forum (which i do not remember) to call
rc with full path,
Code:

# /sbin/rc-update add service default


And, hello, it worked... I sure do not know why. I checked if I had to rc-update, allias or somethin of the sort.
But I followed mv's advice and did a qcheck, and this is what I got. It seems that there are a bunch of odd ends here.

Code:

# qcheck -a -B
media-sound/alsa-utils
dev-texlive/texlive-mathextra
dev-texlive/texlive-latex
dev-texlive/texlive-formatsextra
dev-texlive/texlive-basic
app-text/texlive-core
sys-process/cronbase
dev-lang/ghc
net-wireless/wpa_supplicant
sys-apps/sysvinit
sys-apps/openrc
sys-apps/baselayout
sys-devel/gcc
app-emulation/emul-linux-x86-opengl
net-print/cups


and

Code:

Checking sys-apps/openrc-0.11.8 ...
 MD5-DIGEST: /etc/init.d/net.lo
 MD5-DIGEST: /etc/conf.d/hostname
 MD5-DIGEST: /etc/conf.d/hwclock
 MD5-DIGEST: /etc/rc.conf
  * 298 out of 302 files are good


woooo.. . hostname and hwclock and rc.conf have bad md5 digest... but doesn't mean anything, does it? These are text files which I can change.
Back to top
View user's profile Send private message
mv
Advocate
Advocate


Joined: 20 Apr 2005
Posts: 3783

PostPosted: Sat Jun 08, 2013 12:12 pm    Post subject: Re: Well 'tis is fishy... Reply with quote

wpkzz wrote:
woooo.. . hostname and hwclock and rc.conf have bad md5 digest... but doesn't mean anything, does it? These are text files which I can change.

These two are files which you probably have changed - therefore the differing md5 from the fresh install. However, init.d/net.lo looks more serious, since you shouldn't have a reason to modify that file
Back to top
View user's profile Send private message
wpkzz
n00b
n00b


Joined: 28 Feb 2013
Posts: 22

PostPosted: Sun Jun 09, 2013 12:14 am    Post subject: Reply with quote

No, it is not serious at all. I just put a crazy comment in one line of net.lo to see if it was really being used. It was when I discovered that many services were not starting.
Back to top
View user's profile Send private message
Captain Newbie
Apprentice
Apprentice


Joined: 22 Dec 2006
Posts: 182
Location: Socal

PostPosted: Mon Jun 10, 2013 3:20 pm    Post subject: Reply with quote

A recent (funtoo, don't taze me) install has the same problem. Standby one, gonna re-merge openrc and see if that'll fix it. (Seems to be that something is rotten with openrc.)

edit: yeah, that:
Code:
emerge -1 openrc
rc

<solved>
_________________
/* Nobody will ever see this message :-) */
panic("Cannot initialize video hardware\n");
"As much as it pains me, we hope that developers know what they're doing." - wolf31o2
Back to top
View user's profile Send private message
Deathwing00
Moderator
Moderator


Joined: 13 Jun 2003
Posts: 4078
Location: Barcelona, Spain

PostPosted: Wed Jun 12, 2013 4:25 pm    Post subject: Reply with quote

Did you add your hostname to /etc/hosts?

Something like 127.0.0.1 <FQDN> <hostname> localhost ... should do the thing.
Back to top
View user's profile Send private message
Deathwing00
Moderator
Moderator


Joined: 13 Jun 2003
Posts: 4078
Location: Barcelona, Spain

PostPosted: Wed Jun 12, 2013 4:26 pm    Post subject: Reply with quote

Moved from Installing Gentoo to Networking & Security.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum