links:

  debian::

    # The dhcpd.conf will be be installed in by the server profile scripts
    # But what the heck, just to be sure we do it again

    /etc/dhcp/dhcpd.conf ->! /etc/dhcp/dhcpd-debian-edu.conf
		nofile=force
 
    # the cleanup script for network swap 
    /etc/cron.daily/nbdswap-cleanup ->! /usr/share/debian-edu-config/tools/nbdswap-cleanup

directories:
  debian.ltspserver::
      #correct ownership for nbd-server.
      /var/opt/ltsp/swapfiles  mode=700 owner=nbd group=nbd

files:
  debian.ltspserver|debian.workstation|debian.standalone::
    # ldm fail if Xsession is not executable
    /etc/X11/Xsession mode=a+x  act=fixall

  debian.ltspserver::
    #needed for nbd-server to startup
    /opt/ltsp/$(ltsp_arch)/etc/nbd-server mode=a+r act=fixall
    #Needed for nbdswapd  config file
    /etc/ltsp/nbdswapd.conf owner=root group=root mode=644 act=touch


editfiles:


  debian.ltspserver::
    #Set the correct swapfile area
    { /etc/ltsp/nbdswapd.conf
      AppendIfNoSuchLine 'SWAPDIR=/var/opt/ltsp/swapfiles'
# timeout disabled as it does not work properly
#      AppendIfNoSuchLine 'NBD_SERVER_OPTS="-a 3600"'
    }

  debian.server|ltspserver::
    # Reduce NFS traffic by allowing NFS clients to talk to the FAM server instead
    { /etc/fam.conf
         ReplaceAll "local_only = false" With "local_only = true"
    }

  debian.ltspserver::

    # The file /etc/default/isc-dhcp-server controls what interface the dhcp
    # server will listen on. We will have one monster dhcpd.conf file
    # that contains definitions for both the eth0 and eth1 interfaces
    # and control which is active by manipulating this
    # /etc/default/isc-dhcp-server

    # If this host is the primary server, then cf.dhcpserver will
    # Replace 'INTERFACES=""' with 'INTERFACES="eth0".  This rule will
    # then append 'INTERFACES="$INTERFACE eth1"' to the shell script
    # fragment to make sure both interfaces are used.
    #
    # Make sure this is synced with cf.dhcpserver

    
    { /etc/default/isc-dhcp-server
      AppendIfNoSuchLine 'INTERFACES="$INTERFACES eth1"'
    }


    # Make the tftp-daemon run change-rooted (-s switch) using the standard
    # ltsp directory as root. Very messy otherwise.
    
    { /etc/inetd.conf
       BeginGroupIfNoMatch "tftp           dgram   udp     wait    root  /usr/sbin/in.tftpd -s /tftpboot"
         ReplaceAll "\/var\/ftpd" With "-s /tftpboot"
       EndGroup
    }

    # Set up NFS config file to allow thin clients to mount their 
    # root file system and the swap files.
    # FIXME: Modify network definition to revert to 255.255.254.0 netmask: 
    
    { /etc/exports
      AppendIfNoSuchLine "/opt/ltsp/$(ltsp_arch)             10.0.0.0/255.0.0.0(ro,async,no_root_squash,subtree_check) 192.168.0.0/255.255.0.0(ro,async,no_root_squash,subtree_check) 127.0.0.1(ro,async,no_root_squash,subtree_check,insecure)"
    }

    # Allow authentication by host to various services
    # Don't forget NFS uses portmap and needs this
    # FIXME: Is all this still needed for NFSv4?
    
    { /etc/hosts.allow
      AppendIfNoSuchLine "bootpd:   0.0.0.0"
      AppendIfNoSuchLine "in.tftpd: 192.168.0."
      AppendIfNoSuchLine "in.tftpd: 10."
      AppendIfNoSuchLine "in.tftpd: 127.0.0.1"
      AppendIfNoSuchLine "portmap:  192.168.0."
      AppendIfNoSuchLine "portmap:  10."
      AppendIfNoSuchLine "portmap:  127.0.0.1"
     }
     
     { /etc/X11/fs/config
      CommentLinesMatching "no-listen = tcp"
     }

     # Make sure LTSP servers by default allow access local devices on
     # thin clients.  Require pam_group in common-auth.
     # http://www.die.net/doc/linux/man/man5/group.conf.5.html
     # document # the format.
     { /etc/security/group.conf
       AppendIfNoSuchLine "*; *; *; Al0000-2400; fuse"
     }

     # Make sure local device work out of the box (Bug #1184).  In Ubuntu,
     # this kernel loading is done by the fuse-utils package.  It is not
     # don in the 2.5.3-4.4 debian package.
     { /etc/modules
       AppendIfNoSuchLine "fuse"
     }

  debian.ltspclient::
    # FIXME:  Could not find this in the chroot.  
    # However, if added, NFSv4 with sec=krb5X does still not work.
    { /etc/defaults/nfs-common
      AppendIfNoSuchLine "RPCGSSDOPTS=-n"
    }

shellcommands:

  debian.thirdpass.ltspserver::
	# Divert some binaries to get them working with Pulseaudio or
	# ESD on thin clients.
        "/usr/sbin/debian-edu-ltsp-audiodivert create"
