15.9. Normal Termination

Options used:



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 clear and the done_jobs and done_jobs_max_age values are zero (0), the job is removed.

  10. If the done_jobs or done_jobs_max_age values are nonzero, the spool queue is periodically checked and for an excess number of jobs or jobs with old status. This action is suppressed if either the save_when_done or save_on_error flag is set.