This should cause "/etc/init.d/hostname.sh" to successfully start at boot
and work correctly with the dhclient-script patch.

--- /etc/init.d/hostname.sh 2011-11-02 17:11:20.000000000 -0400
+++ /etc/init.d/hostname.sh 2011-11-03 10:24:28.000000000 -0400
@@ -20,7 +20,7 @@
 . /lib/lsb/init-functions

 do_start () {
- [ -f /etc/hostname ] && HOSTNAME="$(cat /etc/hostname)"
+ [ -s /etc/hostname ] && HOSTNAME="$(cat /etc/hostname)"

  # Keep current name if /etc/hostname is missing.
  [ -z "$HOSTNAME" ] && HOSTNAME="$(hostname)"
@@ -28,6 +28,9 @@
  # And set it to 'localhost' if no setting was found
  [ -z "$HOSTNAME" ] && HOSTNAME=localhost

+ # Or set to localhost if hostname is "(none)"
+ [ "$HOSTNAME" = "(none)" ] && HOSTNAME=localhost
+
  [ "$VERBOSE" != no ] && log_action_begin_msg "Setting hostname to
'$HOSTNAME'"
  hostname "$HOSTNAME"
  ES=$?

Tim Heckman

Attachment: hostname.sh.diff
Description: Binary data

Reply via email to