Home > Uncategorized > hostname and nfsboot

hostname and nfsboot

Here is the script I use to set the host name of a nfsboot client. On Debian it should be set as /etc/init.d/hostname.sh.

#! /bin/sh -x
ETH=eth1

IP=$(ifconfig $ETH | head -n2 | tail -n1 | sed 's/:/ /g' | awk '{ print $3 }')
HN=$(cat /etc/hosts | grep $IP | awk '{ print $2 }')
hostname $HN

If hostname is not propertly set one symptom is that rpc.statd doe’s not start (see man rpc.statd, -n option, to know why).

Advertisements
Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: