> -----Original Message-----
> From: Joel Hammer [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 15, 2003 6:57 PM
> To: Van Sickler, Jim; [EMAIL PROTECTED]
> 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@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 [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.
-----------------------------------------------------------------------------

Reply via email to