Alex Perry wrote:
>4. We don't use the reservation feature of the server, or rely on the
>DNS keeping synchronized with the leases, because it is too unreliable.
>The LTS.CONF file lets you identify hosts by MAC address as well as the
>usual hostname or ipaddr choices, thereby eliminating that dependency.
We modified lts.conf and rc.local to register our LTSP clients' Hostnames with DNS
automatically.
We added a parameter to lts.conf for our asset number (hostname). Then we added a
section to rc.local that attempts to make the hostname the assetnumber. Some of the
code is redundant but it gets the point across. I check to see if the Assetnumber
starts with "ATT" just because all of our asset numbers start with "ATT."
************************************************************************
echo "Creating ramdisk on /tmp"
RAMDISK_SIZE=`get_cfg RAMDISK_SIZE 1024`
/sbin/mke2fs -q -m0 /dev/ram1 ${RAMDISK_SIZE}
/bin/mount -n /dev/ram1 /tmp
pr_set 70 "Setting Hostname"
###############################################################################
#
# Set the Hostname to the AssetNumber or MAC address - Added by Abraham Pearson
#
ASSET_NUMBER=`get_cfg ASSET_NUMBER BLANK`
ASSET_NUMBER=`echo "${ASSET_NUMBER}" | tr [a-z] [A-Z]`
echo "Current Asset number: ${ASSET_NUMBER}"
MAC_ADDRESS=`/sbin/ifconfig -a eth0 |/bin/grep HWaddr |/bin/awk ' {print $5}' |
/bin/awk -F : ' {print $1$2$3$4$5$6}' `
case "${ASSET_NUMBER}" in
ATT*) echo "${ASSET_NUMBER}" >>/proc/sys/kernel/hostname
;;
att*) echo "${ASSET_NUMBER}" >>/proc/sys/kernel/hostname
;;
*) echo "${MAC_ADDRESS}" >>/proc/sys/kernel/hostname
;;
esac
#echo "`/sbin/ifconfig -a eth0 |/bin/grep HWaddr |/bin/awk ' {print $5}' | /bin/
awk -F : ' {print $1$2$3$4$5$6}' `" >>/proc/sys/kernel/hostname
HOSTNAME=`hostname`
echo "Current hostname: ${HOSTNAME}"
################################################################################
#
# Get the IP address of the default server. This is used for XDM_SERVER,
# TELNET_HOST and SYSLOG_HOST if any of them are not set explicitly.
# Default to '192.168.0.254' if it is NOT set in the config file.
*********************************************************************************
Then we added this part to add the A and reverse lookup records to Microsoft DNS:
*********************************************************************************
DNS_SERVER=`get_cfg DNS_SERVER ${DEFAULT_SERVER}`
echo "nameserver ${DNS_SERVER}" >>/tmp/resolv.conf
NFS_SERVER=`get_cfg NFS_SERVER ${DEFAULT_SERVER}`
###############################################################################
#
# Update the Domain Name server - Added by Abraham Pearson
#
IP_ADDRESS=`/sbin/ifconfig -a eth0 |/bin/grep "inet addr:" |/bin/awk '{print $2}
' | /bin/awk -F : '{print $2}'`
REVERSE_IP=`echo $IP_ADDRESS|/bin/awk -F . '{print $4"."$3"."$2"."$1".in-addr.ar
pa"}'`
# First create the script file:
echo "server 192.168.5.2" > /tmp/nsupdate.txt
echo "prereq yxdomain ${HOSTNAME}.${SEARCH_DOMAIN}" >>/tmp/nsupdate.txt
echo "update delete ${HOSTNAME}.${SEARCH_DOMAIN}" >>/tmp/nsupdate.txt
echo "" >>/tmp/nsupdate.txt
echo "prereq nxdomain ${HOSTNAME}.${SEARCH_DOMAIN}" >>/tmp/nsupdate.txt
echo "update add ${HOSTNAME}.${SEARCH_DOMAIN} 2592000 A ${IP_ADDRESS}" >>/tmp/ns
update.txt
echo "" >>/tmp/nsupdate.txt
echo "prereq yxdomain ${REVERSE_IP}" >>/tmp/nsupdate.txt
echo "update delete ${REVERSE_IP}" >>/tmp/nsupdate.txt
echo "" >>/tmp/nsupdate.txt
echo "prereq nxdomain ${REVERSE_IP}" >>/tmp/nsupdate.txt
echo "update add ${REVERSE_IP} 2592000 PTR ${HOSTNAME}.${SEARCH_DOMAIN}" >>/tmp/
nsupdate.txt
echo "" >>/tmp/nsupdate.txt
echo "server 192.168.5.3" >> /tmp/nsupdate.txt
echo "prereq yxdomain ${HOSTNAME}.${SEARCH_DOMAIN}" >>/tmp/nsupdate.txt
echo "update delete ${HOSTNAME}.${SEARCH_DOMAIN}" >>/tmp/nsupdate.txt
echo "" >>/tmp/nsupdate.txt
echo "prereq nxdomain ${HOSTNAME}.${SEARCH_DOMAIN}" >>/tmp/nsupdate.txt
echo "update add ${HOSTNAME}.${SEARCH_DOMAIN} 2592000 A ${IP_ADDRESS}" >>/tmp/ns
update.txt
echo "" >>/tmp/nsupdate.txt
echo "prereq yxdomain ${REVERSE_IP}" >>/tmp/nsupdate.txt
echo "update delete ${REVERSE_IP}" >>/tmp/nsupdate.txt
echo "" >>/tmp/nsupdate.txt
echo "prereq nxdomain ${REVERSE_IP}" >>/tmp/nsupdate.txt
echo "update add ${REVERSE_IP} 2592000 PTR ${HOSTNAME}.${SEARCH_DOMAIN}" >>/tmp/
nsupdate.txt
echo "" >>/tmp/nsupdate.txt
# Now run nsupdate with the script file:
nsupdate /tmp/nsupdate.txt
################################################################################
#
# Setup swap
#
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_____________________________________________________________________
Ltsp-discuss mailing list. To un-subscribe, or change prefs, goto:
https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help, try #ltsp channel on irc.freenode.net