1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 3<html> 4 <head> 5 <meta name="generator" content="HTML Tidy, see www.w3.org"> 6 <title>Queue Lock File</title> 7 <meta name="GENERATOR" content= 8 "Modular DocBook HTML Stylesheet Version 1.7"> 9 <link rel="HOME" title=" LPRng Reference Manual" href= 10 "index.htm"> 11 <link rel="UP" title="Spool Queues and Files" href= 12 "spoolqueue.htm"> 13 <link rel="PREVIOUS" title="Spool Queues and Files" href= 14 "spoolqueue.htm"> 15 <link rel="NEXT" title="Spool Control File " href= 16 "queuecontrolfile.htm"> 17 </head> 18 19 <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link= 20 "#0000FF" vlink="#840084" alink="#0000FF"> 21 <div class="NAVHEADER"> 22 <table summary="Header navigation table" width="100%" border= 23 "0" cellpadding="0" cellspacing="0"> 24 <tr> 25 <th colspan="3" align="center">LPRng Reference Manual: 5 26 Sep 2003 (For LPRng-3.8.22)</th> 27 </tr> 28 29 <tr> 30 <td width="10%" align="left" valign="bottom"><a href= 31 "spoolqueue.htm" accesskey="P">Prev</a></td> 32 33 <td width="80%" align="center" valign="bottom">Chapter 34 13. Spool Queues and Files</td> 35 36 <td width="10%" align="right" valign="bottom"><a href= 37 "queuecontrolfile.htm" accesskey="N">Next</a></td> 38 </tr> 39 </table> 40 <hr align="LEFT" width="100%"> 41 </div> 42 43 <div class="SECT1"> 44 <h1 class="SECT1"><a name="QUEUELOCKFILE">13.2. Queue Lock 45 File</a></h1> 46 47 <ul> 48 <li> 49 <p><var class="LITERAL">spool_lock_file</var><span class= 50 "emphasis"><i class="EMPHASIS">spool queue lock file - 51 default %P</i></span></p> 52 </li> 53 </ul> 54 <br> 55 <br> 56 57 <p>When the <b class="APPLICATION">lpd</b> server starts 58 printing, it will fork individual worker processes to service 59 each queue. To prevent multiple processes from working on the 60 same queue, a printer lock file specified by the <var class= 61 "LITERAL">queue_lock_file</var> option (default <var class= 62 "LITERAL">%P</var> - the %P is expanded to the print queue 63 name) is used. In our example, the lock file would be: <tt 64 class="FILENAME">/var/lpd/pr/pr</tt>.</p> 65 66 <p>The process ID of the currently active printer is stored 67 in the lock file. By reading the lock file and testing to see 68 if the process is still active, programs such as <b class= 69 "APPLICATION">lpq</b> can determine queue activity.</p> 70 71 <p>Similarly, the worker process may need to create other 72 processes to assist it. These in turn will create lock or 73 temporary files in the spool directory as well.</p> 74 </div> 75 76 <div class="NAVFOOTER"> 77 <hr align="LEFT" width="100%"> 78 79 <table summary="Footer navigation table" width="100%" border= 80 "0" cellpadding="0" cellspacing="0"> 81 <tr> 82 <td width="33%" align="left" valign="top"><a href= 83 "spoolqueue.htm" accesskey="P">Prev</a></td> 84 85 <td width="34%" align="center" valign="top"><a href= 86 "index.htm" accesskey="H">Home</a></td> 87 88 <td width="33%" align="right" valign="top"><a href= 89 "queuecontrolfile.htm" accesskey="N">Next</a></td> 90 </tr> 91 92 <tr> 93 <td width="33%" align="left" valign="top">Spool Queues 94 and Files</td> 95 96 <td width="34%" align="center" valign="top"><a href= 97 "spoolqueue.htm" accesskey="U">Up</a></td> 98 99 <td width="33%" align="right" valign="top">Spool Control 100 File</td> 101 </tr> 102 </table> 103 </div> 104 </body> 105</html> 106 107