[Spacewalk-list] Machine getting the wrong hostname

Paul Robert Marino prmarino1 at gmail.com
Tue Feb 17 22:32:47 UTC 2015


check the systemid file in /etc/sysconfig/rhn

Often times when a host is rekickstarted as a different role this file
gets preserved and can cause the profile name not to match the host
name.
As far as how it gets the hostname it essentially directly calls the
system libraries which are also used by the hostname command. so the
hostname is what ever the you would get from the hostname command.

Now the profile name is a separate field which defaults to the name
the hostname at the time of first registration, but after it can be
set can be set to any thing you want. The profile name is what you see
when you see a list of systems in the GUI not the hostname. I susspect
this is whats causing the confusion.

furthermore if you want to hard set the hostname at kickstart append
"hostname=<hostname here>" to the boot options when you boot the host.

By the way as stated before this can be altered in the GUI (under the
host details sub tab), the API's or even spacecmd (which uses the
API's) you shouldn't edit the database directly ever if you can avoid
it.





On Mon, Feb 16, 2015 at 4:48 PM, Francoeur, Louis
<Louis_Francoeur at silanis.com> wrote:
> Found my problem.
>
>
>
> Someone had created a /etc/hostname which was containing a wrong hostname
> (may be a legacy thing).
>
>
>
> Once I removed the culprit, everything was working like it is supposed to.
>
>
>
> Thanks for your help.
>
>
>
> From: spacewalk-list-bounces at redhat.com
> [mailto:spacewalk-list-bounces at redhat.com] On Behalf Of Brian Kinney
> Sent: Friday, February 13, 2015 4:27 PM
>
>
> To: spacewalk-list at redhat.com
> Subject: Re: [Spacewalk-list] Machine getting the wrong hostname
>
>
>
> The only other thing I can think of is that it was previously already in
> Spacewalk and it is reassociating itself to the old name.
>
>
>
> --
>
> Brian A. Kinney
>
> Director of Technical Operations
> Memeo, a Division of UNICOM Global
> t: +1.408.355.7243 c: +1.408.442.4150
>
> brian.kinney at memeo-inc.com
>
>
>
> This e-mail is private and may be confidential and is for the intended
> recipient only. If misdirected, please notify us by telephone and confirm
> that it has been deleted from your system and any copies destroyed. If you
> are not the intended recipient you are strictly prohibited from using,
> printing, copying, distributing or disseminating this e-mail or any
> information contained in it.  We use reasonable measures to virus scan all
> E-mails leaving UNICOM Global but no warranty is given that this E-mail and
> any attachments are virus free. You should ensure you have adequate measures
> in place for your own virus checking.
>
>
>
> From: spacewalk-list-bounces at redhat.com
> [mailto:spacewalk-list-bounces at redhat.com] On Behalf Of Francoeur, Louis
> Sent: Friday, February 13, 2015 8:10 AM
> To: spacewalk-list at redhat.com
> Subject: Re: [Spacewalk-list] Machine getting the wrong hostname
>
>
>
> Actually no.
>
>
>
> The “System Name” in the “Edit System Details” is not the same as the
> “Hostname” in the “System Info”.
>
>
>
> The /etc/sysconfig/network always been with the proper name.
>
>
>
> Louis
>
>
>
> From: spacewalk-list-bounces at redhat.com
> [mailto:spacewalk-list-bounces at redhat.com] On Behalf Of Matthew Madey
> Sent: Thursday, February 12, 2015 5:12 PM
> To: spacewalk-list at redhat.com
> Subject: Re: [Spacewalk-list] Machine getting the wrong hostname
>
>
>
> You can just click on the server in the Spacewalk GUI, then the properties
> tab. Here you can update the System Name here rather than having to change
> tables in the database manually.
>
>
>
> On Thu, Feb 12, 2015 at 3:09 PM, Francoeur, Louis
> <Louis_Francoeur at silanis.com> wrote:
>
> The bad hostname at some point was in the hosts file but under 127.0.1.1.
>
>
>
> Even after cleaning up the hosts and rebooted the server. Still same thing.
>
>
>
> I got tired of running around and went into the database and did the rename
> in the table rhnservernetwork:
>
>
>
> update rhnservernetwork set hostname = propername' where server_id =
> '1000000000';
>
>
>
> I will keep an eye on it to see if it gets reset to the badname again.
>
>
>
> Louis
>
>
>
> From: spacewalk-list-bounces at redhat.com
> [mailto:spacewalk-list-bounces at redhat.com] On Behalf Of Brian Kinney
> Sent: Thursday, February 12, 2015 3:18 PM
>
>
> To: spacewalk-list at redhat.com
> Subject: Re: [Spacewalk-list] Machine getting the wrong hostname
>
>
>
> OK – perhaps we’re looking at the wrong server in this equation.
>
> Verify what the DNS “on the spacewalk server” thinks server “whatever” is.
>
> If you’re reusing IPs you could simply have old data on the spacewalk box,
> not the node.
>
>
>
> You can attach png or jpg files and show us in detail what you are seeing,
> should this not be helpful.
>
>
>
> --
>
> Brian
>
>
>
> This e-mail is private and may be confidential and is for the intended
> recipient only. If misdirected, please notify us by telephone and confirm
> that it has been deleted from your system and any copies destroyed. If you
> are not the intended recipient you are strictly prohibited from using,
> printing, copying, distributing or disseminating this e-mail or any
> information contained in it.  We use reasonable measures to virus scan all
> E-mails leaving UNICOM Global but no warranty is given that this E-mail and
> any attachments are virus free. You should ensure you have adequate measures
> in place for your own virus checking.
>
>
>
> From: spacewalk-list-bounces at redhat.com
> [mailto:spacewalk-list-bounces at redhat.com] On Behalf Of Matthew Madey
> Sent: Wednesday, February 11, 2015 5:36 PM
> To: spacewalk-list at redhat.com
> Subject: Re: [Spacewalk-list] Machine getting the wrong hostname
>
>
>
> When I do rhnreg_ks I specify the profile name as the fully qualified domain
> name, like this:
>
>
>
> rhnreg_ks --serverUrl=https://spacewalk/XMLRPC --profilename=`hostname -f`
> --activationkey=1-blabla
>
>
>
> On Wed, Feb 11, 2015 at 5:03 PM, Brian Kinney <brian.kinney at memeo-inc.com>
> wrote:
>
> The DNS may not match the actual “hostname” of the new box.
>
> Also, just because it is in /etc/hosts, does not mean that it is the true
> “hostname.”
>
>
>
> To find out:
>
> On a unix box, just type in “hostname” and press enter.
>
> That will show you what the system thinks its own name is.
>
>
>
> For windows, you have to right click on my computer, then properties to see
> the hostname.
>
>
>
> --
>
> Brian
>
>
>
> This e-mail is private and may be confidential and is for the intended
> recipient only. If misdirected, please notify us by telephone and confirm
> that it has been deleted from your system and any copies destroyed. If you
> are not the intended recipient you are strictly prohibited from using,
> printing, copying, distributing or disseminating this e-mail or any
> information contained in it.  We use reasonable measures to virus scan all
> E-mails leaving UNICOM Global but no warranty is given that this E-mail and
> any attachments are virus free. You should ensure you have adequate measures
> in place for your own virus checking.
>
>
>
> From: spacewalk-list-bounces at redhat.com
> [mailto:spacewalk-list-bounces at redhat.com] On Behalf Of Francoeur, Louis
> Sent: Wednesday, February 11, 2015 2:26 PM
> To: spacewalk-list at redhat.com
> Subject: [Spacewalk-list] Machine getting the wrong hostname
>
>
>
> Hi!
>
> I have a strange problem. I have a machine with a name, let say hostname1.
>
>
>
> When I to the registering of it with:
>
>
>
> rhnreg_ks --serverUrl=https://spacewalk/XMLRPC --activationkey=1-blabla
>
>
>
> When I check the detail I see a hostname of “whatever”.
>
>
>
> I have checked the DNS (forward and reverse), /etc/hosts and cannot find why
> I get that hostname.
>
>
>
> Someone know what I should do to correct.
>
>
>
> Thanks
>
> Louis Francoeur
>
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
>
>
>
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
>
>
>
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list




More information about the Spacewalk-list mailing list