View previous topic :: View next topic |
Author |
Message |
pstickar n00b
Joined: 26 Nov 2006 Posts: 53 Location: Germany
|
Posted: Fri Feb 15, 2013 8:51 pm Post subject: [solved] This is (none) unknown_domain (Linux x86_64) |
|
|
Hi,
i'm not able to set the hostname. I can login and internet is reachable. During boot, syslog-ng gives the error message: "ERROR: syslog-ng needs (service(s): hostname".
If I type I get a solution (there is a hostname at the next login), but I need to re-type that command after every reboot. I would prefer a more solid solution.
The context: this is an installation of Gentoo as a VirtualBox guest on windows, and
Code: |
#cat /etc/hosts
127.0.0.1 laptop.tenaris laptop localhost
#cat /etc/conf.d/hostname
hostname="laptop"
#cat /etc/conf.d/net
dns_domain_lo="tenaris"
config_eth0="dhcp"
#rc-update show
...
dhcpcd | default
hostname | default
net.eth0 | default
net.lo | boot
syslog-ng | default
... |
Thanks in avance!
Kind regards, _________________ p.
Last edited by pstickar on Sat Feb 16, 2013 5:10 pm; edited 1 time in total |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Fri Feb 15, 2013 9:46 pm Post subject: |
|
|
I can't tell you when, i think going from baselayout1 to 2, but hostname is boot service for a long time. |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Sat Feb 16, 2013 4:04 am Post subject: |
|
|
hostname should be in the boot runlevel
recommend deleting dns_domain_lo="tenaris" ; it causes an overwrite of resolv.conf. _________________ Defund the FCC. |
|
Back to top |
|
|
666threesixes666 Veteran
Joined: 31 May 2011 Posts: 1248 Location: 42.68n 85.41w
|
Posted: Sat Feb 16, 2013 4:24 am Post subject: |
|
|
mkultra@mksrv [ ~ ]$ cat /etc/conf.d/hostname
# Set to the hostname of this machine
hostname="mksrv"
yeah hostname is boot.....
mkultra@mksrv [ ~ ]$ sudo rc-update | grep hostname
hostname | boot
the 1st part of this response is because traditional linux systems command is hostname to set the hostname, and it is not controlled by a /etc/conf.d/hostname file. |
|
Back to top |
|
|
pstickar n00b
Joined: 26 Nov 2006 Posts: 53 Location: Germany
|
Posted: Sat Feb 16, 2013 1:31 pm Post subject: |
|
|
Hi!
Thank you for the suggestions and the comments.
First I removed the hostname service from the default runlevel, then re-added it to the boot runlevel:
Code: | rc-update del hostname
rc-update add hostname boot
|
Besides, I commented out the line
dns_domain_lo="tenaris"
in /etc/conf.d/net.
After the reboot, still no luck.
#rc-update show | grep hostname
hostname | boot
And something very strange to me:
Code: |
# rc-status boot
Runlevel: boot
hwclock [ started ]
sysctl [ started ]
modules [ started ]
fsck [ started ]
root [ started ]
mtab [ started ]
swap [ started ]
localmount [ started ]
tmpfiles.setup [ started ]
bootmisc [ started ]
net.lo [ started ]
procfs [ started ]
termencoding [ started ]
swapfiles [ started ]
urandom [ started ]
keymaps [ started ]
|
It looks like I'm not getting the hostname service in the boot runlevel.
According to the installation guidelines, I shouldn't do anything. Just give "hostname laptop" and then move on to "emerge gentoo-sources". I'm now suspecting that I misstyped something somewhere, and I'm not able to realize where.
As before, any help will be very appreciated.
Kind regards
p. _________________ p. |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Sat Feb 16, 2013 2:35 pm Post subject: |
|
|
here:
does not show hostname, just as yours does not, --must be a "feature"-- Code: | rc-update show boot | does show hostname Code: | /etc/init.d/hostname start | produces Quote: | * WARNING: hostname has already been started | Code: | /etc/init.d/hostname restart | produces Quote: | * WARNING: you are stopping a boot service
* Setting hostname to fx8150 ... | Code: | cat /etc/init.d/hostname | produces Quote: | #!/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"
}
| suggesting you should either see an error message or Setting hostname to laptop on the screen _________________ Defund the FCC. |
|
Back to top |
|
|
pstickar n00b
Joined: 26 Nov 2006 Posts: 53 Location: Germany
|
Posted: Sat Feb 16, 2013 2:56 pm Post subject: |
|
|
Donahue, your answer lead me to the solution. It seems to be that I misstakenly overwrote the file /etc/init.d/hostname (was identical to /etc/cond.d/hostname).
I just retyped it from your answer, rebooted, and now it works. Just hope gentoo does not preserve my modifications over upcoming upgrades.
Thank you very much for your help, people!
Kind regards,
PS. I should probably change the status of this question to "solved", but I do not realize how. I'll research some more... _________________ p. |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Sat Feb 16, 2013 4:22 pm Post subject: |
|
|
edit subject line of your original post _________________ Defund the FCC. |
|
Back to top |
|
|
|