[Samba] Re: LPRng: RE: How do I get the @#$$% job name to show instead of smbprn.yad a.yada?

Joel Hammer Joel at HammersHome.com
Fri Jan 17 01:06:00 GMT 2003


Question: I am not sure what you mean by the Lanier displaying
anything. Is there a display on the printer? Is this a network printer
that talks to the server? This may be an idiosyncracy of the lanier.

Suggestion:
Is there a way to modify the print command in smb.conf so that it mv's
the job from samba.xxx to ProperJobName, and then print the job with
lpr and forget about the %J parameter?

For example, without trying this, I could certainly see putting into the
smb.conf print command something like this:
mv %s %J
lpr %J

Other questions:
Are you getting the right name when viewed from the windows clients?
If lpq is working properly on the server, do you have the correct lpq
command in your smb.conf?  eg.

	lpq command = /usr/bin/lpq -PWin4LinZ53

Does the user printing have permissions to use lpq?

Have you specifed which printing system (lprng) you are using in your smb.conf
file? BSD is the default, or, at least it was.

Another suggestion:
You might use tcpdump to monitor what is sent back and forth between
the server and the clients. I would THINK the server would be sending
back the jobname for display, but, I haven't tried this.

Joel


On Thu, Jan 16, 2003 at 06:43:20PM -0500, Van Sickler, Jim wrote:
> > -----Original Message-----
> > From: Joel Hammer [mailto:Joel at HammersHome.com]
> > Sent: Wednesday, January 15, 2003 6:57 PM
> > To: Van Sickler, Jim; samba at lists.samba.org
> > Subject: Re: [Samba] How do I get the @#$$% job name to show 
> > instead of
> > smbprn.yada.ya da?
> > 
> > 
> > If the file name is right in /tmp/J, then it looks like samba 
> > is working ok.
> > 
> > I guess the question would be, does your version of lpr support the -J
> > option? lpr -H shows all the options. 
> > 
> > What happens if you just print a file on your linux server 
> > (with the printer
> > turned off) with:
> > 
> > lpr  -J"This is my banner" FileToPrint
> > 
> > lpq should show something like this:
> > 
> >  Rank   Owner/ID                   Class Job  Files           
> >     Size Time
> > active  jlh at hammer2+227               A  227 This is my 
> > banner  24 20:43:27   
> > 
> > Joel
> > 
> > 
> > On Wed, Jan 15, 2003 at 07:35:25PM -0500, Van Sickler, Jim wrote:
> > > I'm tinkering with this mod to my smb.conf,
> > > and can't get the actual filename to be
> > > displayed in the printed job history.
> > > 
> > > It's adapted from one Joel put out on the list
> > > last year.  My impression is that it works for
> > > everyone in the world but me....
> > > 
> > > All that ever shows up is smbprn.yada.yada...
> > > in the printer's history of printed jobs.
> > > 
> > > print command = echo %J %p %s  >>  /tmp/junkJ;\
> > > a="`echo '%J' | sed "s/^.*- //"`" ;\
> > > echo This is truncated $a >> /tmp/junkJ;\
> > > /usr/local/bin/lpr -P%p  -J"$a" -U%m %s;\
> > > rm %s
> > > 
> > > Looking in /tmp/junkJ, the $a is the filename,
> > > as it's supposed to be.
> > > 
> > > 
> > > I'm running OpenBSD 3.2, LPRng 3.8.19.  Clients are
> > > all Win2k/SP2.  The printer(s) are a mix of HP4s,
> > > and a new Lanier 2138 (Ricoh 3800c in sheeps clothing).
> > > 
> > > I think something isn't being parsed/passed
> > > correctly between Samba and LPRng.
> > > 
> > > Using the standard LPRng Print Command produces the
> > > same results (lpr -P%p -r %s), so it almost seems
> > > as though the -J%J job info parameter is being
> > > ignored (when I add it to the Print Command)
> > > 
> > > Any help would be appreciated.
> > > 
> > > Jim
> > > -- 
> > > To unsubscribe from this list go to the following URL and read the
> > > instructions:  http://lists.samba.org/mailman/listinfo/samba
> > 
> ---------------------------------------------------
> 
> >From Samba 2.2.7pre1's print_generic.c:
> 
> 	pstrcpy(print_directory, pjob->filename);
> 	p = strrchr(print_directory,'/');
> 	if (!p)
> 		return 0;
> 	*p++ = 0;
> 
> 	if (chdir(print_directory) != 0)
> 		return 0;
> 
> 	pstrcpy(jobname, pjob->jobname);
> 	pstring_sub(jobname, "'", "_");
> 	slprintf(job_page_count, sizeof(job_page_count)-1, "%d",
> pjob->page_count);
> 	slprintf(job_size, sizeof(job_size)-1, "%d", pjob->size);
> 
> 	/* send it to the system spooler */
> 	ret = print_run_command(snum, 
> 			  lp_printcommand(snum), NULL,
> 			  "%s", p,
>   			  "%J", jobname,
> 			  "%f", p,
> 			  "%z", job_size,
> 			  "%c", job_page_count,
> 			  NULL);
> 
> ---------------------------------------------------------------
> 
> I'm confused about what %J holds.
> 
> >From the above, it holds the smbprn.yada.yada filename from
> the samba spool directory;  not the Win2k-supplied file name.
> When I look at the LPRng control file for the job in the
> /var/spool/lpd/2138 subdir, Jwinfilename is in there...
> but the Lanier History is displaying the smbprn.yada.yada
> as the filename.
> 
> Any of these produce the same result;
> user=machine name (as it should)
> Document Name=smbprn.yada.yada
> 
> Normal Print Command:
> /usr/local/bin/lpr -U%m -P%p -r %s
> /usr/local/bin/lpr -U%m -J%J -P%p -r %s
> 
> >From scripted section Print Command:
> /usr/local/bin/lpr -P%p  -J"$a" -U%m %s;\
> /usr/local/bin/lpr -P%p  -J"Test by Jim" -U%m %s;\
> /usr/local/bin/lpr -P%p  -J$a -U%m %s;\
> /usr/local/bin/lpr -P%p  -J%J -U%m %s;\
> /usr/local/bin/lpr -P%p  -J"%J" -U%m %s;\
> 
> But according to /tmp/junkJ, $a is the windows file name, not
> the spool file name.  So does the control file in the
> spool directory.
> 
> If I send a file to the Lanier from the command line,
> the file name is always listed as the Document Name.
> e.g.
> /usr/local/bin/lpr -P2138  -Jlmhosts /etc/samba/lmhosts
> /usr/local/bin/lpr -P2138  -J"lmhosts" /etc/samba/lmhosts
> /usr/local/bin/lpr -P2138  -J"This is lmhosts" /etc/samba/lmhosts
> 
> lpq shows the file name as either "lmhosts" or
> "This is lmhosts", but the Lanier shows it as
> /etc/samba/lmhosts
> 
> ----------------------------------------------------
> 
> Maybe I'm off the mark here...and the Lanier is the bozo.
> 
> I don't think so yet, because it's only displaying what
> the samba server/LPRng are passing on to it.  Or is it?
> How does it get the smbprn.yada.yada as the filename?
> 
> LPRng is sending the right info, as far as lpq shows;  but
> it isn't sending the right info to the Lanier, as far as
> the Doc Name of smbprn.yada.yada shows.  
> 
> What part Samba is playing, I'm not sure yet.  It all
> seems to be working as it should, but I'm not
> satisfied.
> 
> Jim
> 
> -----------------------------------------------------------------------------
> 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 majordomo at lprng.com (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 majordomo at lprng.com
> with:                           | example:
> subscribe LIST <mailaddr>       |  subscribe lprng-digest myname at host.org
> unsubscribe LIST <mailaddr>     |  unsubscribe lprng myname at host.org
> 
> If you have major problems,  send email to papowell at astart.com with the word
> LPRNGLIST in the SUBJECT line.
> -----------------------------------------------------------------------------



More information about the samba mailing list