A.3 Script Quick Reference

The remainder of this section provides a brief explanation of each Novell Linux Point of Service script, its function, and usage.

A.3.1 poscheckip.pl

poscheckip.pl is a helper script that looks up a server’s IP address in LDAP and outputs the netmask and domain name related to that entry.

Function

poscheckip is used from within posInitBranchserver.sh to determine the netmask and domain name related to the hostname of the Branch Server. The information is then used to configure the resolver (/etc/resolv.conf).

Usage

poscheckip.pl 

Files

/etc/opt/SLES/POS/branchserver.conf

A.3.2 posInitBranchserver.sh

The purpose of posInitBranchserver.sh is to generate the central configuration file for all other Novell Linux Point of Service scripts used on a Branch Server, to generate header files needed for automated configuration of DNS and DHCP, to generate configuration files for the DNS and DHCP services, to add a multicast route for TFTP, to activate the DNS, DHCP, and TFTP services at boot time, and to start the services. Information from LDAP is used where applicable.

Function

When running this script, you are prompted to enter the company name, country abbreviation, IP address, and the LDAP administrator password of the Administration Server. The /etc/opt/SLES/POS/branchserver.conf configuration file is generated by filling in the LDAP base, LDAP administrator password, and the IP address of the Administration Server. The /etc/opt/SLES/POS/template/branchserver.conf.template file is used as template.

The posInitBranchserver.sh script uses poscheckip.pl to find its own IP address in LDAP. It only works correctly if the Branch Server data in LDAP was created properly in advance using the posAdmin tool after the installation of the Administration Server. For further information, refer to Section 6.0, Using posAdmin to Manage the LDAP Directory.

The poscheckip.pl script also yields the domain name for this branch, which is used to generate proper configuration header files for the DHCP and DNS services, which in turn are needed for posldap2dns.pl and posldap2dhcp.pl.

The zone file header for posldap2dns.pl is generated from /etc/opt/SLES/POS/template/dns-zonefile.header.template and written to /var/named/ldap_generated/dns-zonefile.header.

The resolver configuration /etc/resolv.conf is written, then posldap2dns.pl and posldap2dhcp.pl are run and the DNS and DHCP services are started.

Finally, a multicast route is set up and the TFTP service is started. The configuration of the multicast route is also stored in /etc/sysconfig/network/routes so it is activated at boot time.

Usage

Run posInitBranchserver.sh on a Branch Server.

Files

/etc/opt/SLES/POS/named/named.conf
/etc/opt/SLES/POS/template/dhcpd.conf.header.template
/etc/opt/SLES/POS/dhcpd/dhcpd.conf.header
/etc/opt/SLES/POS/template/dns-zonefile.header.template
/var/named/ldap_generated/dns-zonefile.header
/etc/opt/SLES/POS/template/resolv.conf.template
/etc/resolv.conf
/etc/sysconfig/network/routes

A.3.3 posInitEdir.sh

The purpose of posInitEdir.sh is to configure the LDAP directory in Novell eDirectory™. You are prompted to enter the tree name, company name, country abbreviation, and the LDAP administration password. Company name and country abbreviation are used to compose the LDAP base DN in the form o=company,c=us.

Function

posInitEdir.sh uses /etc/opt/SLES/POS/template/edir.schema to create the LDAP directory. The LDAP base DN, and password are replaced with the corresponding user entries. After generating the configuration file, eDirectory is started.

posInitEdir.sh uses posReadPassword.pl during the password entry to hide the password characters.

Usage

Run posInitEdir.sh on an Administration Server.

WARNING:Running this script overwrites any existing eDirectory tree on the server.

Files

/etc/opt/SLES/POS/template/edir.schema

A.3.4 posInitLdap.sh

The purpose of posInitLdap.sh is to configure the OpenLDAP directory server software and to create the initial data in the LDAP directory. You are prompted to enter the company name, country abbreviation, and the LDAP administration password. You can also enable or disable SSL communication. Company name and country abbreviation are used to compose the LDAP base DN in the form o=company,c=us.

Function

posInitLdap.sh uses /etc/opt/SLES/POS/template/slapd.conf.template to create the OpenLDAP configuration file, /etc/openldap/slapd.conf. The LDAP base DN and password are replaced from the posInitLdap.sh script with the corresponding user entries. After generating the configuration file, the OpenLDAP service is started.

posInitLdap.sh then uses a template file, /etc/opt/SLES/POS/template/ldif.pos.template, to create an LDAP data file, /etc/opt/SLES/POS/template/ldif.pos, which it then imports into the LDAP directory. Now the initial LDAP directory structure is available on the Administration Server.

posInitLdap.sh uses posReadPassword.pl during the password entry to hide the password characters.

Usage

Run posInitLdap.sh on an Administration Server.

WARNING:Running this script destroys any existing data in LDAP.

Files

/etc/openldap/ldap.conf
/etc/openldap/slapd.conf
/etc/opt/SLES/POS/template/slapd.conf.template
/etc/init.d/ldap
/etc/opt/SLES/POS/template/ldap.template
/etc/opt/SLES/POS/template/ldif.pos.template

A.3.5 posldap2crconfig.pl

posldap2crconfig.pl creates or updates configuration files for Point of Service terminals. Those configuration files are generated by gathering data from LDAP; they contain the information required to boot the Point of Service terminal such as partition information, image, partitioning, hard drive, and so forth.

Function

In normal operation, posldap2crconfig.pl does a part of what is done by posleases2ldap.pl: it looks for hwtype.MAC_address files uploaded by Point of Service terminals, looks up the terminal’s LDAP entry, assigns the hardware type and the default image for this hardware type in terminal’s LDAP entry, and finally generates the configuration files in the CR subdirectory under the tftpboot directory. The file uploaded by the Point of Service terminal is then removed from the /tftpboot/upload directory.

posldap2crconfig.pl can optionally be run with the --dumpall parameter. Using this mode, posldap2crconfig.pl regenerates the config.MAC_address and hardware configuration files for all Point of Service terminals found in LDAP.

NOTE:When posldap2crconfig generates syslog messages, these messages are displayed in all open shell windows of the Branch Server, if the default setting of the configuration file /etc/syslog.conf is used. To avoid this behavior, edit the following line in /etc/syslog.conf and change it as shown below:

# *.emerg                        *

Usage

posldap2crconfig.pl [--dumpall]

Files

/etc/opt/SLES/POS/branchserver.conf

A.3.6 posldap2dhcp.pl

posldap2dhcp.pl generates the DHCP daemon configuration file from LDAP.

Function

posldap2dhcp.pl is called by posleases2ldap.pl at regular intervals. First, all scLocation objects are looked up in LDAP. Each of these objects defines a subnet and for each of them a subnet declaration in the dhcpd.conf is generated.

The header zone file is taken from the file specified in the configuration file directive LDAP2DHCP_TEMPLATEFILE, which is /etc/opt/SLES/POS/dhcpd/dhcpd.conf.header by default. The content of the header file is adapted to the installation by posInitBranchserver.sh (see Section A.3.2, posInitBranchserver.sh).

The value of the scDhcpRange attribute in a scLocation object is translated into a range statement in the subnet declaration.

In addition, the options for tftpboot are written into each subnet declaration. For each scCashRegister, a fixed address declaration is generated.

Function

The new dhcpd.conf file is first generated in a temporary directory. If it differs from the working version, dhcpc is run with the temporary file in check mode. If it passes the check, it is copied over the working file and the command to restart the DHCP daemon is returned to be executed by posleases2ldap.pl.

Usage

posldap2dhcp.pl is called by posleases2ldap.pl.

Files

/etc/opt/SLES/POS/branchserver.conf
/etc/dhcpd.conf -> /etc/opt/SLES/POS/dhcpd/dhcpd.conf
/etc/opt/SLES/POS/dhcpd/dhcpd.conf.header

A.3.7 posldap2dns.pl

posldap2dns.pl generates DNS configuration and zone files from LDAP.

Function

posldap2dns.pl is called by posleases2ldap.pl at regular intervals. First, all scLocation objects are looked up in LDAP. Each of these objects defines a subnet and for each of them a zone file is created.

The header of each zone file is taken from the file specified in the configuration file directive POS_LDAP2DNS_ZONETEMPLATE, which is /var/named/ldap_generated/dns-zonefile.header by default. The content of the zone file header is adapted to the installation by posInitBranchserver.sh (see Section A.3.2, posInitBranchserver.sh).

The value of the scDhcpRange attribute in a scLocation object is translated into a \$GENERATE directive. For each scService or scHAService, an A record is created or, if multiple objects of that kind point to the same IP address, a CNAME record. After that, an A record for each Point of Service terminal is generated.

Finally, the /var/named/ldap_generated/named.zones file containing the definitions of all generated zones is created. It is included from within /etc/named.conf. If zones were changed, posldap2dns.pl returns the appropriate commands to restart the DNS service. The commands are executed by posleases2ldap.pl.

Usage

posldap2dns.pl is called by posleases2ldap.pl.

Files

/etc/opt/SLES/POS/branchserver.conf
/var/named/ldap_generated/
/var/named/ldap_generated/dns-zonefile.header
/var/named/ldap_generated/named.zones
/etc/named.conf

A.3.8 posleases2ldap.pl

posleases2ldap.pl registers new Point of Service terminals in LDAP and transfers image install notification data to LDAP. It also triggers posldap2crconfig.pl.

Function

See Section A.2, Core Script Process for a detailed description of posleases2ldap.pl.

Usage

In normal operation, posleases2ldap.pl is run as a daemon. It can be started by using the /etc/init.d/posleases2ldap init script, which is also used to start the daemon at boot time. To enable this, use chkconfig posleases2ldap on.

If posleases2ldap.pl is started manually, it immediately backgrounds itself. To avoid this, use the optional parameter -d. If started in this way, posleases2ldap closes when the shell is closed.

Files

/etc/opt/SLES/POS/branchserver.conf
/tftpboot/upload/hwtype.MAC_address

A.3.9 posReadPassword.pl

posReadPassword.pl is a helper script for password entry that does not show the entered password.

Function

posReadPassword.pl is called by posInitLdap.sh, posInitEdir.sh, and posInitBranchserver.sh for password entry purposes.

Usage

From within shell scripts, use a line such as

PASSWORD=`posReadPassword.pl`

Files

None.

A.3.10 possyncimages.pl

The possyncimages.pl script must be run on a Branch Server to download or update the images from the Administration Server. It uses RSYNC and requires that the RSYNC service is properly configured and running on the Administration Server. This script can be run manually, but depending on your system requirements, you can create a cron job that runs the script every night to keep the images up to date.

Function

possyncimages.pl reads the /etc/opt/SLES/POS/branchserver.conf configuration file and uses the definitions POS_REMOTE_SYNC_COMMANDS and POS_LOCAL_SYNC_COMMANDS from that file. POS_REMOTE_SYNC_COMMANDS contains a list of RSYNC commands that obtain the data from the Administration Server. These commands are executed first.

On success, the commands in the POS_LOCAL_SYNC_COMMANDS directory are executed to update the final destination of the images.

Usage

Run possyncimages.pl on a Branch Server or set up a cron job. A crontab line for nightly run at 1 a.m. might look like this:

0 1 * * * /usr/sbin/POSsyncimages.pl

Files

/etc/opt/SLES/POS/branchserver.conf