LPRng-HOWTO: 15 Oct 2001 (For LPRng-3.7.9)
Prev | Chapter 15. Job Processing | Next

# 15.8. Normal Termination

Options used:

- `fq` FLAG Form Feed on Close

- `la` FLAG Local Printer Accounting

- `tr=`Trailer on Close

- `ae=`Accounting at end

- `save_when_done` FLAG Save when done

- `wait_for_eof` FLAG Wait for EOF before closing device

- `socket_linger` socket linger timeout

- `half_close` FLAG use shutdown() and not close()

Sequence of Operations:

1. If we are printing and the `fq` flag is set and the `sf` (suppress interfile FF) flag is set, then the `ff` (form feed) string will be interpreted and sent to the of_fd.

2. If we are printing, the `tr` (trailer) string will be interpreted and sent to the of_fd.

3. If printing and the `la` (local printer accounting) flag is set or transferring a job and the `ar` (remote accounting) flag is set, the `ae` is examined and accounting is done as described for the as field.

4. If the `:of` filter is present, its STDIN is closed, and the lpd server waits for it to exit. The exit status is used as described above.

5. If the device is a socket or network connection, the socket linger time is set to `socket_linger` value if nonzero.

6. If the `half_shut` flag is set, then a `shutdown(fd,WR_DONE)` will be done on the connection. This tells the TCP/IP stack that all data transmission has been completed. Errors or other information can still be read from the connection. If the `half_shut` flag is clear, then a `close(fd)` will be done and no errors or other information will be read.

7. If the `wait_for_eof` option is true (default) then a read is done on the connection until an EOF is found. The device (io_fd) is then closed.

8. The job is marked as completed in the spool queue.

9. If the `save_when_done` flag is not specified, the job is removed.

Prev | Home | Next
Printing Banner At End of Job | Up | Abnormal Termination