Answer:
Run
lpc -Dnetwork,1 release lp [jobnum] >/tmp/log 2>&1
You will see the command you need in the /tmp/log file in hte
network debugging stuff.
The command has the foramat:
\006printer user command printer options
So this would be:
\006lp root release lp
It is even documented in the HOWTO...
Patrick
> From [EMAIL PROTECTED] Thu Jan 17 12:55:31 2002
> From: "Floyd Shackelford" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Subject: lprng lpd remote command control operation
> Date: Thu, 17 Jan 2002 13:57:38 -0600
>
> This is a multi-part message in MIME format.
>
> ------=_NextPart_000_007F_01C19F5E.EC78B380
> Content-Type: text/plain;
> charset="iso-8859-1"
> Content-Transfer-Encoding: 7bit
>
> this is my first time communicating to you, so let me say thank you very
> much for your work on lprng. it's a great product.
>
> i need help getting the lpc requests documented in section "19.8 LPC
> Requests" of the manual to work. if i make a non-modifying call (e.g. lpq or
> status), i get the expected results. if i use a modifying call (e.g.
> release), i get back the following response:
>
> Printer: lp@redhat
> lp@redhat: no
>
> Huh? it's telling me no! i admit i had to laugh at that reponse. i haven't
> had a computer tell me no in a very long time.
>
> My command string is as follows:
>
> \006lp@redhat root@redhat release lp 447
>
> where:
>
> \006 is a single byte of value 6
> lp is the printer spool name
> redhat is the host name
> 447 is the job number
>
> here's what lpq shows me:
>
> [root@redhat LPRng]# lpq
> Printer: lp@redhat (dest lp@kyocera)
> Queue: no printable jobs in queue
> Holding: 1 held jobs in queue
> Server: no server active
> Status: job 'cfA427redhat.cmsdiginet.com' error 'aborting operations' at
> 11:55:25.126
> Filter_status: no sync response from printer at 09:12:06.403
> Rank Owner/ID Class Job Files Size Time
> hold root@redhat+447 A 447 /etc/hosts 169
> 11:56:10
>
>
> here's my printcap:
>
> lp:
> # :lpd_bounce
> :force_localhost
> :as=|/usr/local/LinuxGateKeeper/LinuxGateKeeperPrintJobFilter.sh
> :sd=/var/spool/lpd/%P
> :mx=0
> :mc=0
> :sh
> :lp=lp@kyocera
> :done_jobs=5
> # :filter=/usr/local/libexec/filters/ifhp
> # :ifhp=model=hp4000
>
> lp:server
> :lpd_port=515
> :reuse_addr=1
> :retry_econnrefused=1
> :retry_nolink=1
> :socket_linger=1
> :remote_support=1
> :originate_port=512 1023
>
>
> here's my java code that makes the request:
>
> public String ReleaseJobOnHold(JobInfo jobInfo)
> throws IOException
> {
> Connect();
>
> OutputStream outputStream = _socket.getOutputStream();
>
> // the control operation has the following format:
> // \006printer user command [options]
> Write(outputStream,DO_CONTROL_OPERATION); // \006
> Write(outputStream,jobInfo._printerName + " ");
> Write(outputStream,jobInfo._submittedByUserID + "@" +
> jobInfo._submittedByHost + " ");
>
> // the release command has the following format:
> // release (printer[@host] | all) (name[@host] | job | all)*
> String commandLine =
> "release " +
> jobInfo._printerName + " " +
> String.valueOf(jobInfo._jobNumber);
> System.out.println("command="+commandLine);
> Write(outputStream,commandLine);
> Write(outputStream,LF);
>
> // read the result
> InputStream inputStream = _socket.getInputStream();
> String inputLine = Read(inputStream);
>
> Done();
>
> return inputLine;
> }
>
>
> how do i get LPRng to release the job?
>
> Regards,
>
> Floyd Shackelford
> 4 Peaks Technology Group, Inc.
> VOICE: 334.735.9428
> FAX: 916.404.7125
> EMAIL: [EMAIL PROTECTED]
> Acta non verba
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.312 / Virus Database: 173 - Release Date: 12/31/2001
>
> ------=_NextPart_000_007F_01C19F5E.EC78B380
> Content-Type: text/html;
> charset="iso-8859-1"
> Content-Transfer-Encoding: quoted-printable
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=3DContent-Type content=3D"text/html; =
> charset=3Diso-8859-1">
> <META content=3D"MSHTML 5.50.4912.300" name=3DGENERATOR></HEAD>
> <BODY>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial>this is my =
> first time=20
> communicating to you, so let me say thank you very much for your work on =
> lprng.=20
> it's a great product.</FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial></FONT></SPAN> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial>i need help =
> getting the lpc=20
> requests documented in section "19.8 LPC Requests" of the manual to =
> work. if i=20
> make a non-modifying call (e.g. lpq or status), i get the expected =
> results. if i=20
> use a modifying call (e.g. release), i get back the following=20
> response:</FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial></FONT></SPAN> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial> =
> Printer: <A=20
> href=3D"mailto:lp@redhat">lp@redhat</A><BR> <A=20
> href=3D"mailto:lp@redhat">lp@redhat</A>: no</FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial></FONT></SPAN> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial>Huh? it's =
> telling me no! i=20
> admit i had to laugh at that reponse. i haven't had a computer tell me =
> no in a=20
> very long time.</FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial></FONT></SPAN> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial>My command =
> string is as=20
> follows:</FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial></FONT></SPAN> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial>\006lp@redhat =
> <A=20
> href=3D"mailto:root@redhat">root@redhat</A> release lp =
> 447</FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial></FONT></SPAN> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial>where:</FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial></FONT></SPAN> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial> \006 is =
> a single=20
> byte of value 6</FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial> lp is =
> the printer=20
> spool name</FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial> redhat =
> is the host=20
> name</FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial> 447 is =
> the job=20
> number</FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial></FONT></SPAN> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial>here's what lpq =
> shows=20
> me:</FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial></FONT></SPAN> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial>[root@redhat =
> LPRng]#=20
> lpq<BR>Printer: <A href=3D"mailto:lp@redhat">lp@redhat</A> (dest <A=20
> href=3D"mailto:lp@kyocera">lp@kyocera</A>)<BR> Queue: no printable =
> jobs in=20
> queue<BR> Holding: 1 held jobs in queue<BR> Server: no server=20
> active<BR> Status: job 'cfA427redhat.cmsdiginet.com' error =
> 'aborting=20
> operations' at 11:55:25.126<BR> Filter_status: no sync response =
> from=20
> printer at 09:12:06.403<BR> Rank =20
> Owner/ID  =
> ; =20
> Class Job=20
> Files &n=
> bsp; =20
> Size Time<BR>hold <A=20
> href=3D"mailto:root@redhat+447">root@redhat+447</A> &nbs=
> p; =20
> A 447=20
> /etc/hosts &nb=
> sp; =20
> 169 11:56:10<BR></FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial></FONT></SPAN> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial>here's my=20
> printcap:</FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial></FONT></SPAN> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial>lp:<BR># =20
> :lpd_bounce<BR> :force_localhost<BR> =20
> :as=3D|/usr/local/LinuxGateKeeper/LinuxGateKeeperPrintJobFilter.sh<BR>&nb=
> sp;=20
> :sd=3D/var/spool/lpd/%P<BR> :mx=3D0<BR> :mc=3D0<BR> =
> :sh<BR> =20
> :lp=3Dlp@kyocera<BR> :done_jobs=3D5<BR># =20
> :filter=3D/usr/local/libexec/filters/ifhp<BR># =20
> :ifhp=3Dmodel=3Dhp4000</FONT></SPAN></DIV>
> <DIV><FONT face=3DArial></FONT> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial>lp:server<BR> =20
> :lpd_port=3D515<BR> :reuse_addr=3D1<BR> =
> :retry_econnrefused=3D1<BR> =20
> :retry_nolink=3D1<BR> :socket_linger=3D1<BR> =
> :remote_support=3D1<BR> =20
> :originate_port=3D512 1023 <BR></FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial> </DIV></FONT></SPAN>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial>here's my java =
> code=20
> that makes the request:</FONT></SPAN></DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial></FONT></SPAN> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial> public =
> String=20
> ReleaseJobOnHold(JobInfo jobInfo)<BR> throws=20
> IOException<BR> {<BR> =
> Connect();</FONT></SPAN></DIV>
> <DIV><FONT face=3DArial></FONT> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial> =20
> OutputStream outputStream =3D =
> _socket.getOutputStream();</FONT></SPAN></DIV>
> <DIV><FONT face=3DArial></FONT> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial> // the=20
> control operation has the following format:<BR> =
> // =20
> \006printer user command [options]<BR> =20
> Write(outputStream,DO_CONTROL_OPERATION); // =
> \006<BR> =20
> Write(outputStream,jobInfo._printerName + " ");<BR> =20
> Write(outputStream,jobInfo._submittedByUserID + "@" + =
> jobInfo._submittedByHost +=20
> " ");</FONT></SPAN></DIV>
> <DIV> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial> // the=20
> release command has the following format:<BR> =
> // =20
> release (printer[@host] | all) (name[@host] | job | =
> all)*<BR> =20
> String commandLine=20
> =3D<BR> =
> =20
> "release "=20
> +<BR> &n=
> bsp;=20
> jobInfo._printerName + " "=20
> +<BR> &n=
> bsp;=20
> String.valueOf(jobInfo._jobNumber);<BR>System.out.println("command=3D"+co=
> mmandLine);<BR> =20
> Write(outputStream,commandLine);<BR> =20
> Write(outputStream,LF);</FONT></SPAN></DIV>
> <DIV> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial> // read=20
> the result<BR> InputStream inputStream =3D=20
> _socket.getInputStream();<BR> String inputLine =3D=20
> Read(inputStream);</FONT></SPAN></DIV>
> <DIV> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial> =20
> Done();</FONT></SPAN></DIV>
> <DIV> </DIV>
> <DIV><SPAN class=3D440263519-17012002><FONT =
> face=3DArial> return=20
> inputLine;<BR> }<BR> <BR></DIV></FONT></SPAN>
> <DIV><SPAN class=3D440263519-17012002><FONT face=3DArial>how do i =
> get LPRng to=20
> release the job?</FONT></SPAN></DIV>
> <DIV><SPAN style=3D"FONT-SIZE: 10pt"><FONT face=3DArial=20
> size=3D3></FONT></SPAN> </DIV>
> <DIV><SPAN style=3D"FONT-SIZE: 10pt"><FONT face=3DArial =
> size=3D3>Regards,<BR><BR>Floyd=20
> Shackelford<BR></FONT><A href=3D"http://www.4peakstech.com/"><FONT =
> face=3DArial=20
> color=3D#000000 size=3D3>4 Peaks Technology Group, =
> Inc.</FONT></A><BR><FONT=20
> face=3DArial size=3D3>VOICE: 334.735.9428<BR>FAX: =
> 916.404.7125<BR>EMAIL:=20
> </FONT><A href=3D"mailto:[EMAIL PROTECTED]"><FONT face=3DArial =
> color=3D#000000=20
> size=3D3>[EMAIL PROTECTED]</FONT></A></SPAN></DIV>
> <DIV><SPAN style=3D"FONT-SIZE: 10pt">
> <P><FONT size=3D3><EM>Acta non verba</EM></FONT></P></SPAN></DIV>
> <DIV><FONT face=3DArial></FONT> </DIV></BODY></HTML>
>
> ------=_NextPart_000_007F_01C19F5E.EC78B380--
>
>
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------