Author: eelco
Date: Fri Apr  1 15:04:20 2011
New Revision: 26659
URL: https://svn.nixos.org/websvn/nix/?rev=26659&sc=1

Log:
* Make sure that dhclient properly sets the hostname after reboots.

Added:
   nixpkgs/branches/modular-python/pkgs/tools/networking/dhcp/set-hostname.patch
Modified:
   nixpkgs/branches/modular-python/pkgs/tools/networking/dhcp/default.nix

Modified: nixpkgs/branches/modular-python/pkgs/tools/networking/dhcp/default.nix
==============================================================================
--- nixpkgs/branches/modular-python/pkgs/tools/networking/dhcp/default.nix      
Fri Apr  1 15:03:48 2011        (r26658)
+++ nixpkgs/branches/modular-python/pkgs/tools/networking/dhcp/default.nix      
Fri Apr  1 15:04:20 2011        (r26659)
@@ -13,6 +13,11 @@
       # recover when the wlan interface goes down.  Instead just flush
       # all addresses, routes and neighbours of the interface.
       ./flush-if.patch
+
+      # Make sure that the hostname gets set on reboot.  Without this
+      # patch, the hostname doesn't get set properly if the old
+      # hostname (i.e. before reboot) is equal to the new hostname.
+      ./set-hostname.patch
     ];
 
   # Fixes "socket.c:591: error: invalid application of 'sizeof' to

Added: 
nixpkgs/branches/modular-python/pkgs/tools/networking/dhcp/set-hostname.patch
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ 
nixpkgs/branches/modular-python/pkgs/tools/networking/dhcp/set-hostname.patch   
    Fri Apr  1 15:04:20 2011        (r26659)
@@ -0,0 +1,14 @@
+diff -ru -x '*~' dhcp-4.1.2-P1-orig//client/scripts/linux 
dhcp-4.1.2-P1//client/scripts/linux
+--- dhcp-4.1.2-P1-orig//client/scripts/linux   2010-09-15 00:49:48.000000000 
+0200
++++ dhcp-4.1.2-P1//client/scripts/linux        2011-04-01 16:08:10.984372269 
+0200
+@@ -133,9 +133,7 @@
+      [ x$current_hostname = "x(none)" ] || \
+      [ x$current_hostname = xlocalhost ] || \
+      [ x$current_hostname = x$old_host_name ]; then
+-    if [ x$new_host_name != x$old_host_name ]; then
+-      hostname "$new_host_name"
+-    fi
++    hostname "$new_host_name"
+   fi
+     
+   if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to