A.2 Core Script
Process
When Point of Service terminals are being set up in a branch
or subsidiary, the posleases2ldap script must be started as a daemon
on the Branch Server for the respective branch. All other scripts
are controlled by this script.
The interplay of scripts on the Branch Server occurs as follows:
- posleases2ldap is started directly
on the Branch Server. If the scDynamicIp attribute is not set to
TRUE in the respective scLocation, the script immediately terminates.
- posleases2ldap is running as a daemon process and
monitors the /var/lib/dhcpd/dhcpd-leases file
for changes. The script detects in which scLocation (branch) it
is running, using the IP address of the server.
- If posleases2ldap finds MAC addresses in the leases
that are not yet entered in the directory, it generates new entries
for the scWorkstation object class in the DN for the respective scLocation.
The first items filled out are the required attributes macAddress,
ipHostNumber, and the cn for the entry. The terminal’s
IP address and name are automatically generated, and the MAC address
is taken from the leases file. These entries are like an outline.
- A search is made through the upload directory on
the TFTP server for files of the pattern hwtype.MAC_Address that
are being uploaded by Point of Service terminals registered from
the DiskNetboot system. The Point of Service hardware type is specified
in these files. For more information, see Section 3.6, Booting the Point
of Service Terminal. If any files of this type are
found, the following process runs:
- Using the MAC address, the respective
scWorkstation entry is looked up in the LDAP directory. With the
content of the hwtype.MAC_Address file,
the corresponding scRefPc (the reference hardware type in the global
container) is searched. In the scRefPc object (named after the hardware
type), the image type for this hardware type is specified as a reference
to a scPosImage object in the attribute scPosImageDn, which points
to the reference image in the global container. The information
about the reference hardware and image are then added to the scWorkstation
object as distinguished names (DN) and the attributes are named
scRefPcDn and scPosImageDn.
- All information is collected to generate the /tftpboot/CR/config.MAC_Address configuration
file. It is possible to specify hardware type or image type dependent configuration
files, such as XF86config, which would be hardware type dependent.
These files are generated in the /tftpboot/CR/MAC_Address directory.
For this purpose, an object of the class scConfigFileTemplate can
be added to the respective scRefPc or scPosImage object in the global
container.
At this point, the scConfigFileData attribute of the scConfigFileTemplate
object contains the required file. Hardware or image dependent configuration
files are always looked up by the hardware order image.
All newly generated files are initially named with the prefix TMP_.
- The configuration files are renamed from TMP_* to
their final names.The /tftpboot/upload/hwtype.MAC_Address file
is deleted. The registration of a newly detected Point of Service
terminal is complete.
- posleases2ldap starts posldap2dns. The zone files
for the DNS server are regenerated from the directory data as a
temporary file and renamed. The DNS service is restarted if there
are any changes.
- posleases2ldap starts posldap2dhcp. The dhcpd.conf file
is regenerated from the directory data as a temporary file and renamed.
The DHCP service is restarted if there are any changes.
- posleases2ldap runs in a loop starting at point
2 until it is terminated or the scDynamicIp attribute in the scLocation
object for the branch is set to FALSE.
- posleases2ldap starts the ImageNotify daemon. It
monitors /tftpboot/upload for
boot version, MAC address files, and transfers image notify data
to LDAP.