[pkg-dhcp-devel] Bug#609851: hostname.sh patch for dhclient-script patch

Tim Heckman timothy.heckman at gmail.com
Thu Nov 3 14:35:38 UTC 2011


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-dhcp-devel/attachments/20111103/730cec14/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hostname.sh.diff
Type: application/octet-stream
Size: 735 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-dhcp-devel/attachments/20111103/730cec14/attachment.obj>


More information about the pkg-dhcp-devel mailing list