Opened 17 years ago

Closed 15 years ago

Last modified 15 years ago

#361 closed Defect (worksforme)

Linux hostname is always localhost.localdomain

Reported by: Ageless Owned by: davea
Priority: Major Milestone: Undetermined
Component: Client - Daemon Version:
Keywords: linux hostname Cc:

Description

Both in client_state.xml and on any project we connect to with (at least) a 5.10 client, the computername is always shown as localhost.localdomain, never as the hostname of the computer.

When I open a terminal window and do hostname -a it shows my hostname correctly. Not with BOINC though.

I understand from Rom that BOINC calls a POSIXs api to get the local computer name, but that doesn't seem to work. Can't BOINC just read /etc/hostname ? Or use gethostname (see also gethostname(2) ?

Change History (11)

comment:1 Changed 17 years ago by KSMarksPsych

It might help to note which distro.

It does work on my install of Ubuntu Feisty Fawn.

comment:2 Changed 17 years ago by JKeck

It does not work on fedora 6 & 7. I have been able change the client_state.xml file with something more appropriate and it stays. But neither host has updated to the actual hostname of the hosts in question.

comment:3 Changed 17 years ago by MikeMarsUK

Does seem to work OK on my openSUSE 10.2 64-bit (both KDE and Gnome) using 5.10.8 32-bit Boinc.

I've seen other complaints about the same thing though, so not just a one-off. Something to do with the way 127.0.0.1 has been set up on the PC?

comment:4 in reply to:  3 Changed 17 years ago by Ageless

Replying to MikeMarsUK:

I've seen other complaints about the same thing though, so not just a one-off. Something to do with the way 127.0.0.1 has been set up on the PC?

I think so. When checking /etc/hosts the first line shows: 127.0.0.1 localhost.localdomain localhost Ruba Ruba.domain.dom

The last part is my computer name, of course. Yet it reads the first part all the time. And I am not so sure if I can just change it there, without breaking my Mepis 6.5.02 (based on Ubuntu, KDE).

comment:5 Changed 17 years ago by MikeMarsUK

Here's mine. It's different to what I expected (this is the first time I've looked at it on a linux system), note that the machine name (linux-rcud.site) is against the machine's local IP (192.168.1.64, I set it up to be static), rather than against localhost.

mike@linux-rcud:/etc> more hosts

# IP-Address  Full-Qualified-Hostname  Short-Hostname
#

127.0.0.1       localhost

# special IPv6 addresses
::1             localhost ipv6-localhost ipv6-loopback

fe00::0         ipv6-localnet

ff00::0         ipv6-mcastprefix
ff02::1         ipv6-allnodes
ff02::2         ipv6-allrouters
ff02::3         ipv6-allhosts
192.168.1.64    linux-rcud.site linux-rcud

comment:6 Changed 17 years ago by Joses

Seems BOINC uses the 1st name in the hosts file. This example should have BOINC report back it's name as COMPUTER

{{{$ cat /etc/hosts 127.0.0.1 COMPUTER localhost computer.mynetwork computer}}}

comment:7 Changed 16 years ago by icode4u

Not sure this is a problem with BOINC. Very system specific.

BOINC versions 5.8.16, 5.10.45, 6.3.8 all report my hostname correctly on the website.

I'm running Fedora 7/8 and my hosts file is: # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost ::1 localhost6.localdomain6 localhost6

192.168.1.10 pooter.home pooter

comment:8 Changed 15 years ago by davea

Resolution: worksforme
Status: newclosed

The client calls gethostname() to get the host name. Is there a better way?

comment:9 Changed 15 years ago by Nicolas

Well, the first thing I saw when looking at gethostbyname(3) manpage was "These functions are obsolete"...

comment:10 in reply to:  8 Changed 15 years ago by Ageless

Replying to davea:

The client calls gethostname() to get the host name. Is there a better way?

http://linux.about.com/od/commands/l/blcmdl1_hostnam.htm

comment:11 Changed 15 years ago by davea

that page says to call gethostname().

Note: See TracTickets for help on using tickets.