[lug] Lock files....

Wayde Allen wallen at boulder.nist.gov
Thu Apr 20 09:10:51 MDT 2000


On Wed, 19 Apr 2000, John Starkey wrote:

> Could someone explain what a lock file is. I looked for it in RH Unleashed
> and read the man pages (which seem to be somewhat cryptic:}).
> 
> I've seen them several times. One in minicom which is /var/lock.

Others have answered this question.

> But right now I am having a lot of trouble setting up my fiance's Lexmark
> 1100. When I send the first whatever.txt > /dev/lp0 I hear the print head
> positioning and that's all I get. There is a lock file in
> /var/spool/lpd/lp I'm wondering if (by nature of the word "lock") this is
> hindering further progress.

The lock file shouldn't be hindering the operation of your Lexmark
printer.  The lock file only matters to programs running on your PC.  Your
printer is a different device outside your PC and as such has no access to
the lock file.  Only programs running on the PC sending data to the
Lexmark would care about the lock and then only to tell other programs
that they are currently in control of the printer. 

The first question that comes to my mind is how are you sending the text
file to the printer at /dev/lp0?  You can dump a file directly to the
printer using:

   cat whatever.txt > /dev/lp0

This kind of looks like what you are doing, but that should bypass lpd
completely.  I can't imagine a lock file being created by this command.
On the other hand, you should get a lock file if you typed

   lpr whatever.txt

Is your file whatever.txt a true ASCII file?  The file going to the
printer has to be something the printer knows how to print.  Most (all?)
printers can handle straight ASCII.  Anything else has to be converted to
the printers control language.  That's what the print filters are for.

Hope this kind of helps.

- Wayde
  (wallen at boulder.nist.gov)







More information about the LUG mailing list