UNIX onlySetting-up and Releasing Reality Private Printers

The following procedures describe how to convert a UNIX system printer into a Reality private printer, and how to convert it back into a system printer. Refer to Private Printer for a description of private printers.

Converting to a Private Printer

To convert a printer into a Reality private printer, proceed as follows:

  1. Select the printer you wish to convert to a private printer. The printer device you choose must be a device which has previously been set up (using lpadmin) to operate as a UNIX system printer.  Hence it will have a device name which is recognised by UNIX, for example, lptr1. Note that a number of Reality private printer interface scripts (with names starting with "real") are placed in the $REALROOT/file/interfaces directory when Reality is installed and are available when using lpadmin to configure a private printer.

  2. Disable the Despooler interface between the printer and the UNIX Spooler using the disable command followed by the printer name, for example:

    disable lptr1

    This prevents the UNIX Spooler (lp) from despooling print jobs to lptr1.

    Note

    Unix users can still spool jobs to lptr1 - such jobs are queued up within the lp sub-system but cannot reach the printer until it is enabled for despooling again.

  3. Decide who you wish to allow to use the printer (lptr1) and, if necessary, change security parameters (see below).

Setting Up Printer Security

Access to a private printer is determined by setting the appropriate ownership and access permissions for the UNIX device file for the printer.

If access to the printer is to be provided to all Reality users, you can probably leave ownership and access permissions as they are - ensure that ownership is set to lp and access permissions are set to global read and write.  You can check current ownership and access permission details by carrying out step 2 below.

If you want to limit access to certain Reality users, you will need to change the ownership and access permissions of the device file. Proceed to step 1.

Note

The following procedure to set up access permissions requires super-user privileges on the UNIX system.

  1. Find out the name of the UNIX device file attached to the printer (lptr1) using the lpstat command followed by the -v option and printer name. For example, enter:

    lpstat -v lptr1

    This returns a message of the form:

    device for lptr1:  /dev/rt0013
  2. Use the ls command with the device file name to determine current ownership and access permissions. For example, enter:

    ls -l /dev/rt0013

    If ownership and access permissions are correct, start the printer using the procedure described below, otherwise change them by carrying out step 3.

  3. Change the ownership and access permissions of the printer's device file so that it can only be written to by the owner of the database(s) for which access is required.  This is done by setting the ownership to the user-id which owns the database(s) and the access permission to either user only or group only read and write enabled, as appropriate. For example, enter:

    chown pubs /dev/rt0013

    to change the ownership, then

    chmod u+rw /dev/rt0013

    to change permissions.

    This example only allows access by the user 'pubs'.  Only a database user logged on under the user-id 'pubs' can now start a Despooler process for the device using the START-PRINTER command.  The printer then becomes private to the database from which it was started.

Starting the Printer

  1. Using SPM, create a Despooler record, for example LPTR1, setting device type to PTR and device to:

    % InterfaceScript Device

    For example,

    % $REALROOT/files/interfaces/REALDUMB /dev/rt0013

    Then create a formqueue record either by using SPM or by entering:

    SP-CREATE FQ-LPTR1 LPTR1
  2. Start the Reality background despooling. For example, enter:

    START-PRINTER LPTR1

    The form-queue FQ-LPTR1 is now interrogated by the Reality background Despooler process and any print jobs queued in the queue are despooled directly to the private printer on /dev/rt0013.

  3. Any user on the Reality database (with the correct UNIX user-id and access permissions for the printer device) can now assign print jobs to the PTR form queue FQ-LPTR1 using the command:

    SP-ASSIGN FQ-LPTR1

    Note

    The printer device may only be accessed by one process at any one time, thus a particular device should not be referenced by 2 or more active Despoolers on the same or different databases.  This means that a Reality device is only available to users of a single Reality database at any one time.  To use the same device from another database it is necessary to stop the Despooler process on the current database and restart it on the second database.

Restoring a System Printer

To reconfigure a Reality private printer as a UNIX system printer, proceed as follows:

  1. If the form-queue is currently despooling to the private printer, stop the background despooling process using the STOP-PRINTER command.  For example, enter:

    STOP-PRINTER LPTR1

           where LPTR1 is the form-queue assigned for printing to the private printer.

  2. Restore the ownership of the device file to that required for UNIX system printers. For example, if ownership is to be lp then enter:

    chown lp /dev/rt0013

    Also, ensure that access permissions are set to global read and write.

  3. Enable the despool interface between the printer and the UNIX Spooler using the enable command followed by the printer name. For example, enter:

    enable lptr1

    At this point the lp scheduler will start despooling any print jobs currently queued in the lp Spooler for lptr1. The printer can now be used by both UNIX system users and Reality users who use it as a SYS type device.