Re: X session and hostname changing policy



On Mon, 14 Jun 2010 15:26:06 -0500
Robby Workman <rlworkman gmail com> wrote:

> On Mon, 14 Jun 2010 23:16:52 +0300
> Fırat Birlik <fbirlik gmail com> wrote:
> 
> > Hi there,
> > 
> > I experience a problem with hostname manipulation of NetworkManager
> > and the X session.  DHCP server sends a hostname within the dhcp
> > offer, which is different the current one.  There is no persistent
> > hostname definition within the 'nm-system-settings.conf' as this is
> > a default installation.  NetworkManager just changes the hostname
> > and as new hostname is not authenticated (xhost cookie
> > MIT-MAGIC-COOKIE-1 for new hostname does not exist) no new
> > application can be started afterwards.
> > 
> > To avoid this behavior, I can define a persistent hostname equal the
> > content of /etc/HOSTNAME (this is a slackware system) as the
> > following:
> > 
> > --- /etc/NetworkManager/nm-system-settings.conf~
> > +++ /etc/NetworkManager/nm-system-settings.conf
> > @@ -1,2 +1,5 @@
> >  [main]
> >  plugins=keyfile
> > +
> > +[keyfile]
> > +hostname=myhostname
> > 
> > 
> > As persistent hostname has highest precedence, problem looks solved;
> > but this should be repeated for each installation.
> > 
> > What I'm asking is, is there any config option or some way to not
> > let NetworkManager change the hostname?
> > 
> > As a note, current precedence order for hostname (taken from
> > NetworkManagerPolicy.c):
> > 
> > 	 * 1) a configured hostname (from system-settings)
> > 	 * 2) automatic hostname from the default device's config
> > (DHCP, VPN, etc)
> > 	 * 3) the original hostname when NM started
> > 	 * 4) reverse-DNS of the best device's IPv4 address
> > 
> 
> 
> Do you have NM built to use dhcpcd?  If so, dhcpcd should not change
> the system hostname unless you have force_hostname=(YES|TRUE|1) in
> /etc/dhcpcd.conf.   From dhcpcd(8):
> 
>   If the hostname is currently blank, (null) or localhost, or
>     force_hostname is YES or TRUE or 1 then dhcpcd sets the 
>     hostname to the one supplied by the DHCP server.
> 
> -RW


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]