public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] hostname problem
@ 2016-10-02 11:41 Philip Webb
  2016-10-02 11:47 ` Hinnerk van Bruinehsen
  0 siblings, 1 reply; 10+ messages in thread
From: Philip Webb @ 2016-10-02 11:41 UTC (permalink / raw
  To: Gentoo User

I did a big system update yesterday ( 52 pkgs ), incl Net-tools Dhcpcd ,
& on restarting today found that hostname is not being set :

  root:505 etc> echo $HOSTNAME
  (none)

Previously it was 'localhost'.

The problem seems to be in  /etc/init.d/hostname ,
as the init process reports :

  Setting hostname to localhost ...
  /etc/init.d/hostname: line 24: hostname command not found
  *Failed to set the hostname [!!]

I've updated Openrc to the latest testing 0.22.1 , but no change.
I've also tried permutations of changes to  /etc/init.d/hostname .

Can anyone offer advice ?

-- 
========================,,============================================
SUPPORT     ___________//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT    `-O----------O---'   purslowatchassdotutorontodotca



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] hostname problem
  2016-10-02 11:41 [gentoo-user] hostname problem Philip Webb
@ 2016-10-02 11:47 ` Hinnerk van Bruinehsen
  2016-10-02 11:56   ` Mick
  2016-10-02 12:06   ` [gentoo-user] hostname problem : solved Philip Webb
  0 siblings, 2 replies; 10+ messages in thread
From: Hinnerk van Bruinehsen @ 2016-10-02 11:47 UTC (permalink / raw
  To: gentoo-user

On Sun, Oct 02, 2016 at 07:41:48AM -0400, Philip Webb wrote:
> I did a big system update yesterday ( 52 pkgs ), incl Net-tools Dhcpcd ,
> & on restarting today found that hostname is not being set :
> 
>   root:505 etc> echo $HOSTNAME
>   (none)
> 
> Previously it was 'localhost'.
> 
> The problem seems to be in  /etc/init.d/hostname ,
> as the init process reports :
> 
>   Setting hostname to localhost ...
>   /etc/init.d/hostname: line 24: hostname command not found
>   *Failed to set the hostname [!!]
> 
> I've updated Openrc to the latest testing 0.22.1 , but no change.
> I've also tried permutations of changes to  /etc/init.d/hostname .
> 
> Can anyone offer advice ?

Check if sys-apps/net-tools has the "hostname" useflag enabled (it's enabled by
default so you may encounter the fallout of a -* setup...)

WKR
Hinnerk


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] hostname problem
  2016-10-02 11:47 ` Hinnerk van Bruinehsen
@ 2016-10-02 11:56   ` Mick
  2016-10-02 12:06   ` [gentoo-user] hostname problem : solved Philip Webb
  1 sibling, 0 replies; 10+ messages in thread
From: Mick @ 2016-10-02 11:56 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1038 bytes --]

On Sunday 02 Oct 2016 13:47:10 Hinnerk van Bruinehsen wrote:
> On Sun, Oct 02, 2016 at 07:41:48AM -0400, Philip Webb wrote:
> > I did a big system update yesterday ( 52 pkgs ), incl Net-tools Dhcpcd ,
> > 
> > & on restarting today found that hostname is not being set :
> >   root:505 etc> echo $HOSTNAME
> >   (none)
> > 
> > Previously it was 'localhost'.
> > 
> > The problem seems to be in  /etc/init.d/hostname ,
> > 
> > as the init process reports :
> >   Setting hostname to localhost ...
> >   /etc/init.d/hostname: line 24: hostname command not found
> >   *Failed to set the hostname [!!]
> > 
> > I've updated Openrc to the latest testing 0.22.1 , but no change.
> > I've also tried permutations of changes to  /etc/init.d/hostname .
> > 
> > Can anyone offer advice ?
> 
> Check if sys-apps/net-tools has the "hostname" useflag enabled (it's enabled
> by default so you may encounter the fallout of a -* setup...)
> 
> WKR
> Hinnerk

What does /etc/conf.d/hostname contain?

-- 
Regards,
Mick

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] hostname problem : solved
  2016-10-02 11:47 ` Hinnerk van Bruinehsen
  2016-10-02 11:56   ` Mick
@ 2016-10-02 12:06   ` Philip Webb
  2016-10-04  0:04     ` Philip Webb
  1 sibling, 1 reply; 10+ messages in thread
From: Philip Webb @ 2016-10-02 12:06 UTC (permalink / raw
  To: gentoo-user

161002 Hinnerk van Bruinehsen wrote:
> On Sun, Oct 02, 2016 at 07:41:48AM -0400, Philip Webb wrote:
>> I did a big system update yesterday ( 52 pkgs ), incl Net-tools Dhcpcd ,
>> & on restarting today found that hostname is not being set :
>> 
>>   root:505 etc> echo $HOSTNAME
>>   (none)
>> 
>> Previously it was 'localhost'.
>> The problem seems to be in  /etc/init.d/hostname ,
>> as the init process reports :
>> 
>>   Setting hostname to localhost ...
>>   /etc/init.d/hostname: line 24: hostname command not found
>>   *Failed to set the hostname [!!]
>> 
> Check if sys-apps/net-tools has the "hostname" useflag enabled
> it's enabled by default so you may encounter the fallout of a -* setup.

Yes, that was it (red face).  Thanks for the prompt reply.

-- 
========================,,============================================
SUPPORT     ___________//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT    `-O----------O---'   purslowatchassdotutorontodotca



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] hostname problem : solved
  2016-10-02 12:06   ` [gentoo-user] hostname problem : solved Philip Webb
@ 2016-10-04  0:04     ` Philip Webb
  2016-10-04  4:01       ` [gentoo-user] " Ian Zimmerman
  2016-10-04 12:27       ` [gentoo-user] " Todd Goodman
  0 siblings, 2 replies; 10+ messages in thread
From: Philip Webb @ 2016-10-04  0:04 UTC (permalink / raw
  To: gentoo-user

161002 Philip Webb wrote:
> 161002 Hinnerk van Bruinehsen wrote:
>> On Sun, Oct 02, 2016 at 07:41:48AM -0400, Philip Webb wrote:
>>> I did a big system update yesterday ( 52 pkgs ), incl Net-tools Dhcpcd ,
>>> & on restarting today found that hostname is not being set :
>> Check if sys-apps/net-tools has the "hostname" useflag enabled
>> it's enabled by default so you may encounter the fallout of a -* setup.
> Yes, that was it (red face).  Thanks for the prompt reply.

Wanting to make a note for the future in case this happens again,
I have written :

  Hostname set by  /etc/init.d/hostname :
    the binary  /bin/hostname  is provided by Net-tools + USE="hostname" ;
     hostname  needs to be set to  localhost  to make apps work properly :
    this is done via  /etc/hosts ,
     wh belongs to Baselayout & shd contain '127.0.0.1 localhost' ;
    there is also  /etc/conf.d/hostname ,
     wh belongs to Openrc & contains 'hostname="localhost"'.

However, I'm now wondering whether/why the system needs both
 /etc/hosts  +  /etc/conf.d/hostname , which seem to do the same thing.
Can anyone explain ? 

-- 
========================,,============================================
SUPPORT     ___________//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT    `-O----------O---'   purslowatchassdotutorontodotca



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [gentoo-user] Re: hostname problem : solved
  2016-10-04  0:04     ` Philip Webb
@ 2016-10-04  4:01       ` Ian Zimmerman
  2016-10-04 15:23         ` Philip Webb
  2016-10-04 12:27       ` [gentoo-user] " Todd Goodman
  1 sibling, 1 reply; 10+ messages in thread
From: Ian Zimmerman @ 2016-10-04  4:01 UTC (permalink / raw
  To: gentoo-user

On 2016-10-03 20:04, Philip Webb wrote:

> However, I'm now wondering whether/why the system needs both
> /etc/hosts + /etc/conf.d/hostname , which seem to do the same thing.
> Can anyone explain ?

/etc/hosts does a quite different job, it maps names to IP addresses.
It is basically an alternative to DNS, for names which aren't in the
global DNS name space, such as "localhost" - because each person's
"localhost" is distinct.

-- 
Please *no* private Cc: on mailing lists and newsgroups
Personal signed mail: please _encrypt_ and sign
Don't clear-text sign: http://cr.yp.to/smtp/8bitmime.html


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] hostname problem : solved
  2016-10-04  0:04     ` Philip Webb
  2016-10-04  4:01       ` [gentoo-user] " Ian Zimmerman
@ 2016-10-04 12:27       ` Todd Goodman
  2016-10-04 15:19         ` Philip Webb
  1 sibling, 1 reply; 10+ messages in thread
From: Todd Goodman @ 2016-10-04 12:27 UTC (permalink / raw
  To: gentoo-user

* Philip Webb <purslow@ca.inter.net> [161003 20:04]:
> 161002 Philip Webb wrote:
> > 161002 Hinnerk van Bruinehsen wrote:
> >> On Sun, Oct 02, 2016 at 07:41:48AM -0400, Philip Webb wrote:
> >>> I did a big system update yesterday ( 52 pkgs ), incl Net-tools Dhcpcd ,
> >>> & on restarting today found that hostname is not being set :
> >> Check if sys-apps/net-tools has the "hostname" useflag enabled
> >> it's enabled by default so you may encounter the fallout of a -* setup.
> > Yes, that was it (red face).  Thanks for the prompt reply.
> 
> Wanting to make a note for the future in case this happens again,
> I have written :
> 
>   Hostname set by  /etc/init.d/hostname :
>     the binary  /bin/hostname  is provided by Net-tools + USE="hostname" ;
>      hostname  needs to be set to  localhost  to make apps work properly :
>     this is done via  /etc/hosts ,
>      wh belongs to Baselayout & shd contain '127.0.0.1 localhost' ;
>     there is also  /etc/conf.d/hostname ,
>      wh belongs to Openrc & contains 'hostname="localhost"'.
> 
> However, I'm now wondering whether/why the system needs both
>  /etc/hosts  +  /etc/conf.d/hostname , which seem to do the same thing.
> Can anyone explain ? 

I can't speak to why there are multiple ways to do things (just
different ways carried forward I think.)

But recently a change (to OpenRC I believe) requires the line in
/etc/conf.d/hostname to have the environment variable capitalized to be
used.

In your example it needs to contain "HOSTNAME=localhost" and not
"hostname=localhost"

I had one fairly recently installed server run into this problem (and
not my other servers.)

I run ~amd64

Todd


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] hostname problem : solved
  2016-10-04 12:27       ` [gentoo-user] " Todd Goodman
@ 2016-10-04 15:19         ` Philip Webb
  2016-10-04 15:42           ` William Hubbs
  0 siblings, 1 reply; 10+ messages in thread
From: Philip Webb @ 2016-10-04 15:19 UTC (permalink / raw
  To: gentoo-user

161004 Todd Goodman wrote:
> * Philip Webb <purslow@ca.inter.net> [161003 20:04]:
>>     there is also  /etc/conf.d/hostname ,
>>      wh belongs to Openrc & contains 'hostname="localhost"'.
> recently a change -- to OpenRC, I believe -- requires the line
> in  /etc/conf.d/hostname  to have the environment variable capitalized.
> In your example it needs "HOSTNAME=localhost" and not "hostname=localhost".
> I had one fairly recently installed server run into this problem
> I run ~amd64

Well here, I updated to the latest testing Openrc-0.22.1 on Sunday
& it recreated that file with 'hostname' lowercase (smile)
(as you will have noticed, your quotes above are a typo).
Everything is now working as it should.

-- 
========================,,============================================
SUPPORT     ___________//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT    `-O----------O---'   purslowatchassdotutorontodotca



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] Re: hostname problem : solved
  2016-10-04  4:01       ` [gentoo-user] " Ian Zimmerman
@ 2016-10-04 15:23         ` Philip Webb
  0 siblings, 0 replies; 10+ messages in thread
From: Philip Webb @ 2016-10-04 15:23 UTC (permalink / raw
  To: gentoo-user

161003 Ian Zimmerman wrote:
> On 2016-10-03 20:04, Philip Webb wrote:
>> However, I'm now wondering whether/why the system needs both
>> /etc/hosts + /etc/conf.d/hostname , which seem to do the same thing.
> /etc/hosts does a quite different job : it maps names to IP addresses.
> It is basically an alternative to DNS,
> for names which aren't in the global DNS name space, such as "localhost"
> - because each person's "localhost" is distinct.

Thanks : yes I see the difference in function ; added to my notes.

-- 
========================,,============================================
SUPPORT     ___________//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT    `-O----------O---'   purslowatchassdotutorontodotca



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [gentoo-user] hostname problem : solved
  2016-10-04 15:19         ` Philip Webb
@ 2016-10-04 15:42           ` William Hubbs
  0 siblings, 0 replies; 10+ messages in thread
From: William Hubbs @ 2016-10-04 15:42 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 903 bytes --]

On Tue, Oct 04, 2016 at 11:19:33AM -0400, Philip Webb wrote:
> 161004 Todd Goodman wrote:
> > * Philip Webb <purslow@ca.inter.net> [161003 20:04]:
> >>     there is also  /etc/conf.d/hostname ,
> >>      wh belongs to Openrc & contains 'hostname="localhost"'.
> > recently a change -- to OpenRC, I believe -- requires the line
> > in  /etc/conf.d/hostname  to have the environment variable capitalized.
> > In your example it needs "HOSTNAME=localhost" and not "hostname=localhost".
> > I had one fairly recently installed server run into this problem
> > I run ~amd64
> 
> Well here, I updated to the latest testing Openrc-0.22.1 on Sunday
> & it recreated that file with 'hostname' lowercase (smile)
> (as you will have noticed, your quotes above are a typo).
> Everything is now working as it should.

Yes,

the lowercase hostname is correct, not upper case.

Thanks,

William

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-10-04 15:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-02 11:41 [gentoo-user] hostname problem Philip Webb
2016-10-02 11:47 ` Hinnerk van Bruinehsen
2016-10-02 11:56   ` Mick
2016-10-02 12:06   ` [gentoo-user] hostname problem : solved Philip Webb
2016-10-04  0:04     ` Philip Webb
2016-10-04  4:01       ` [gentoo-user] " Ian Zimmerman
2016-10-04 15:23         ` Philip Webb
2016-10-04 12:27       ` [gentoo-user] " Todd Goodman
2016-10-04 15:19         ` Philip Webb
2016-10-04 15:42           ` William Hubbs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox