Configuring $PSTAT
The KCML partition, terminal, global library, and KPrint Licence tables are stored in shared memory known as $PSTAT. These tables are created when the first KCML product is executed after system start-up. Once these tables have been created their size cannot be changed.
| Table | Default Size | bkstat command-line flag | kcml.conf key |
|---|---|---|---|
| Partition | 1024 Unix, 512 Windows | -x max_parts | MaxPartitions |
| Terminal | 1024 Unix, 512 Windows | -y max_terms | MaxPartitions |
| Global library | 20 | -n max_globals | MaxGlobals |
| KPrint Licences | 256 | -R max_lic | MaxKplic |
There a three methods of choosing alternative dimensions of some of the tables in $PSTAT.
Starting KCML 6.20.83 and 7.05, the maximum number of partitions can be configured using a configuration file called /etc/kcml/kcml.conf.
For example, to create a $PSTAT area that can store 4096 partitions/terminals, 32 global library processes and 512 KPrint licences
[PSTAT] MaxPartitions=4096 MaxGlobals=32 MaxKplic=512
This will affect the creation of $PSTAT for all values of $SYSTEMID.
Recent changes and new functionality have required that the size of a partition in $PSTAT to be increased. This is accomplished by the kcmlinst script creating a /etc/kcml/pstat_X file. The size of the partition is 2X, so if /etc/kcml/pstat_8 exists, then a partition will be 256-bytes. When there are multiple pstat_X files, the largest value of X is used.
The original method of configuring alternative $PSTAT sizes was to use bkstat's -x & -y command line switches. This can be done in a boot script which are command shell scripts which are executed when the server boots up. A typical example of this is the boot script for the Remote Licence Daemon. The boot script for the Remote Licence Daemon is executed just before inetd is started ensuring that no-one can log-in, and start a KCML process, before bkstat has created the correctly sized $PSTAT tables.
or example:
# Add /usr/local/kcml to PATH PATH=/sbin:/usr/sbin:/usr/bin:/etc:/usr/ccs/bin:/usr/local/kcml export PATH # Use this script to set up PSTAT and to start KCML deamons # Change size of partition, terminal and KPrint licence tables /usr/local/kcml/bkstat -x 4096 -y 4096 -R 1024 # Start the KPrint licence server /usr/local/kcml/kplicserver &
would allow a maximum of 4096 KCML partitions to run from a maximum of 4096 terminals. The Remote Licence Daemon would also be able to manage licences for 1024 KPrint servers, provided the licence file has enough queues. The max_parts & max_terms values for the -x & -y flags must have the same value.