On Tue, 18 Dec 2001, Rev Simon Rumble wrote:

> I solved my pdf printing problem by trying to log the output of
> ps2pdf.  As soon as I redirected the output of ps2pdf, the files
> started printing just fine!  Can anyone pick why?!?!?

A lot of the time _ANY_ output from a program is interpreted by the caller
(in this case samba) as an error condition. This certainly is the case
when running programs from sendmail's /etc/aliases file. An alternative is 
where you call the script below in the smb.conf file add ">/dev/null" to 
it and if you never want samba to be upset by errors add a further "2>&1" 
to redirect the error output as well. If it fails you can still debug from 
the command line.

 > 
> #!/bin/sh
> 
> # Simple script to convert a specified postscript file into a PDF
>   document
> # and place it in a location that is shared by the Samba server.
> #
> # Arguments:
> #   1st - The name of the spool file
> #
> # John Bright, 2001, [EMAIL PROTECTED]
> 
> # We will create the pdf into a temporary file based upon the current date and time.
> # After we are finished, we'll rename it to a file with the same date, but ending
> # in .pdf.  We do this because if a user tries to open a PDF that is still being 
>written,
> # they will get a message that it is corrupt, when it is actually just not done yet.
> 
> DATE=`date +%b%d-%H%M%S`
> 
> # Directory in which to place the output
> # Be sure this directory exists and is writable by the user that Samba
> # is running as (for example, the nobody user)
> OUTDIR=/var/spool/pdfdropbox
> 
> ps2pdf $1 $OUTDIR/$DATE.temp >/tmp/pdfprint.log
> mv $OUTDIR/$DATE.temp $OUTDIR/$DATE.pdf
> rm $1
> 
> 
> 

-- 
---<GRiP>--- 
Web: www.arcadia.au.com/gripz 
Phone/fax: 02 4950 1194   
Mobile: 0408 686 201


-- 
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to