Date: Sat, 19 Oct 2002 23:23:04 -0400 From: Garance A Drosihn <drosih@rpi.edu> To: cumquott@suscom.net, <freebsd-questions@FreeBSD.ORG> Subject: Re: LPD protocol screwup and ctl_renametf error Message-ID: <p05111707b9d7bf8e83c8@[128.113.24.47]> In-Reply-To: <4403.12.151.4.177.1034961129.squirrel@webmail.suscom.net> References: <4403.12.151.4.177.1034961129.squirrel@webmail.suscom.net>
next in thread | previous in thread | raw e-mail | index | archive | help
At 1:12 PM -0400 10/18/02, TheGlenMann wrote: >On FreeBSD I run lpd -c -l -W, and `cat textfile | lpr -P hp6LServ' >works fine. When I send the test page from Windows, though, I get >these errors: > >lpd[578]: lt_gmann.domain.com requests recvjob hp6LServ >lpd[578]: Error receiving job from lt_gmann.domain.com: >lpd[578]: protocol screwup: ^[%-12345X@PJL SET PAGEPROTECT=AUTO I expect this is a problem with whatever process on the Windows box is sending the lpr job. The above is the beginning of the data for a print job. The problem is that at this point in the processing of the job, 'lpd' is expecting to see a single line that (basically) says "Okay, I am now going to send you a data file". The actual data for the file should come *after* that line, and in this case there is no header line. When lpd sees this "protocol screwup", it will terminate the connection. Note that the following lines have a new process number. The windows client is trying to send the same job a second time. (that's also why you see a second "requests recvjob" line). >lpd[579]: lt_gmann.domain.com requests recvjob hp6LServ >lpd[579]: Error receiving job from lt_gmann.domain.com: >lpd[579]: hp6LServ: ctl_renametf error link > (rfA014lt_gmann.domain.com,cfA014lt_gmann.domain.com): > File exists This indicates that the program on the Windows box is also sending it's files in the wrong order. This is not surprising, as many implementations of the lpr protocol have no idea what they are supposed to be doing, or why. A correctly-written program *should* send all the data files first, and then send the control file for the job. The above error suggests that the Windows program sends the control file first, and then sends the data files. So, the *first* attempt to send the print job did succeed in sending the control file, and then it died while sending the data file. This *second* attempt to send the print job sends the control-file a second time, and it runs into this error because the control file already exists on the freebsd server. >Docs on the subtleties on LPD seem to be in short supply. It >looks like the PAGEPROTECT thing breaks the whole system, then >the cannot rename seems to be Windows trying again to send >the file... The code in lpd is historically a mess, and most people who start to look at it get a headache and decide to write some alternative to lpr/lpd. That's why it remains such a mess. In the case of FreeBSD, Garrett Wollman did clean up some of the code a few years ago, and I've been the one slowly improving it since then. I have plenty of ideas on how to make it better, but too much other work so my progress on it is slow. >How can I determine what is wrong? If the above description does not provide you with enough help, then let me know and I can write up some changes to lpd so we can figure out what's going on in your case. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p05111707b9d7bf8e83c8>