#1874: Can't set hostname to empty string using /etc/sysconfig/network
--------------------+-------------------------------------------------------
 Reporter:  joni78  |        Owner:  [email protected]
     Type:  defect  |       Status:  new                          
 Priority:  normal  |    Milestone:                               
Component:  Book    |      Version:  6.2                          
 Severity:  normal  |   Resolution:                               
 Keywords:          |  
--------------------+-------------------------------------------------------
Changes (by joni78):

  * summary:  /sbin/dhclient-script doesn't set hostname because LFS sets
              hostname to "(none)" => Can't set hostname to
              empty string using /etc/sysconfig/network

Comment:

 Hi Alexander,

 Ok if the kernel itself is setting the hostname to '(none)' then IMHO the
 /sbin/dhclient-script should be able to handle that. This is the section
 of /sbin/dhclient-script where setting the hostname is being handled
 (/sbin/dhclient-script is invoked by dhclient) from line 109 onwards:

 {{{
   current_hostname=`hostname`
   if [ x$current_hostname = x ] || \
      [ x$current_hostname = x$old_host_name ]; then
     if [ x$current_hostname = x ] || \
        [ x$new_host_name != x$old_host_name ]; then
       hostname $new_host_name
     fi
   fi
 }}}

 It seems to me that it should be changed to something like:

 {{{
   current_hostname=`hostname`
   if [ x$current_hostname = x ] || [ $current_hostname = '(none)' ] || \
      [ x$current_hostname = x$old_host_name ]; then
     if [ x$current_hostname = x ] || [ $current_hostname = '(none)' ] || \
        [ x$new_host_name != x$old_host_name ]; then
       hostname $new_host_name
     fi
   fi
 }}}

 Bye,
 Jonathan

-- 
Ticket URL: <http://wiki.linuxfromscratch.org/lfs/ticket/1874>
LFS Trac <http://wiki.linuxfromscratch.org/lfs/>
Linux From Scratch: Your Distro, Your Rules.
--
http://linuxfromscratch.org/mailman/listinfo/lfs-book
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to