LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-23-2003, 10:16 AM   #1
craddy
LQ Newbie
 
Registered: Sep 2003
Posts: 20

Rep: Reputation: 0
Samba & PDF problem


Hello,

I am having difficulties in getting the PDF printing script to work with my Samba server.
At first I was shown the error "Access Denied, Unable to Connect". This was fixed by adding
"Use Client Driver = Yes" to smb.conf.

My problem now is that everything seems to work fine, however no PDF's are created!

Below are what i think are the relevant bits from the Cups and Samba log files. It is a working
file server and all other functions are fine, including regular printing.

Any help would be greatly appreciated.

Richard

Cups error_log line:

E [23/Dec/2003:15:54:56 +0000] print_job: resource name '/printers/pdf' no good!


Samba log line:

[2003/12/23 15:22:12, 0] printing/print_cups.c:cups_job_submit(655)
Unable to print file to pdf - client-error-not-found

Smb.conf

[global]
netbios name = ls
smb passwd file = /etc/smbpasswd
server string = ls
printing = cups
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=8192 SO_RCVBUF=8192
local master = yes
workgroup = Workgroup
os level = 34
auto services = global gm cd's PDFs tech printers OfficeJetLX pdf printer
encrypt passwords = no
printcap name = cups
security = share
wins support = true
browseable = yes
nt smb support = yes
nt pipe support =yes
nt status support = yes
show add printer wizard = yes
domain master = yes

[gm]
path = /data/goldmine
readonly = no
public = yes
[cd's]
comment = CD's
path = /data/cd
public = yes
writable = no
printable = no

[printer$]
comment = Drivers
path = /data/tech/drivers
public = yes
writable = yes

[PDFs]
path = /data/pdf
public = yes
writable = yes

[tech]
comment = Technical Files
path = /data/tech
public = yes
writable = yes


[OJLX]
path = /data/spool/OLX
printer = Office Jet LX
public = yes
writable = no
printable = yes

[pdf]
path = /data/spool/pdf
lpq command =
writeable = no
print command = /usr/bin/printpdf %s
printable = yes
public = yes
lprm command =
create mask = 0700
browseable = yes
use client driver = yes

PDF script:


# 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, jbright@winfordeng.com

# We will create the pdf into a temporary file based upon the current date and t
ime.
# After we are finished, we'll rename it to a file with the same date, but endin
g
# 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=/data/pdf

ps2pdf $1 $OUTDIR/$DATE.temp
mv $OUTDIR/$DATE.temp $OUTDIR/$DATE.pdf
rm $1
 
Old 12-23-2003, 12:44 PM   #2
Ciccio
Member
 
Registered: Nov 2002
Location: Paraguay
Distribution: Mandrake 10
Posts: 573

Rep: Reputation: 30
shouldnt a .ps be created instead of a pdf?
 
Old 12-23-2003, 03:56 PM   #3
craddy
LQ Newbie
 
Registered: Sep 2003
Posts: 20

Original Poster
Rep: Reputation: 0
err...I donít know. (Donít think so.)

I do know is that I want it to be a PDF, not sure if it needs to be saved as postscript. The script shown above is 'sold' as a PDF generator.

Any Ideas, Google and search on here has turned up nothing.

Help greatly appreciated
 
Old 01-16-2004, 04:28 AM   #4
AdamPengelly
LQ Newbie
 
Registered: Oct 2003
Posts: 29

Rep: Reputation: 15
Can you test the pdfprint script by trying a .ps file from your linux box e.g.

/usr/bin/printpdf test.ps

Just locate *.ps to find any .ps file and run it through.

If it appears in the output directory as a pdf, then we've eliminated that script from the problem.
 
Old 01-19-2004, 07:18 AM   #5
craddy
LQ Newbie
 
Registered: Sep 2003
Posts: 20

Original Poster
Rep: Reputation: 0
Cheers Adam!

That works fine, im guessing the problem has something to do with the samba bit of the process?

If it has any bearing, when the printer queue is opened (in windows XP) it says "the printer pdf on ls is initializing" sometimes and when a job is submitted (print test page) it does not appear in the queue.

any help greatly appreciated!

Richard

edit:

This appears in log.smbd

[2004/01/19 13:48:01, 0] smbd/server.c:main(707)
smbd version 2.2.7a-security-rollup-fix started.
Copyright Andrew Tridgell and the Samba Team 1992-2002
[2004/01/19 13:48:01, 0] param/loadparm.c:service_ok(2233)
No path in service pdf - using /tmp
[2004/01/19 13:48:10, 0] smbd/oplock_linux.c:linux_init_kernel_oplocks(287)
Failed to setup RT_SIGNAL_LEASE handler
[2004/01/19 13:48:11, 0] printing/print_cups.c:cups_queue_get(788)
Unable to get jobs for ipp://localhost/printers/pdf - client-error-not-found

Last edited by craddy; 01-19-2004 at 07:52 AM.
 
Old 01-19-2004, 07:58 AM   #6
AdamPengelly
LQ Newbie
 
Registered: Oct 2003
Posts: 29

Rep: Reputation: 15
Richard,

I'm afraid I am no expert at this subject, It took me a while to get mine working, but I love it now. Below I'll stick my config files (smb.conf,printpdf) as there are on my system.
[global]
guest account = nobody
invalid users = root
netbios name = Samba
hosts allow = 192.168.
security=share
workgroup=MARTINHALE

[PDFprint]
path = /pdfshare/pdfs
browseable = yes
writeable = yes
guest ok = yes
force user = nobody

[pdf]
path = /tmp
printable = yes
guest ok = yes
print command = /usr/bin/printpdf %s
lpq command =
lprm command =
 
Old 01-19-2004, 08:01 AM   #7
AdamPengelly
LQ Newbie
 
Registered: Oct 2003
Posts: 29

Rep: Reputation: 15
Well that went wrong, I'll try again, this time without a cat on the keyboard:

[global]
guest account = nobody
invalid users = root
netbios name = Samba
hosts allow = 192.168.
security=share
workgroup=MARTINHALE

[PDFprint]
path = /pdfshare/pdfs
browseable = yes
writeable = yes
guest ok = yes
force user = nobody

[pdf]
path = /tmp
printable = yes
guest ok = yes
print command = /usr/bin/printpdf %s
lpq command =
lprm command =

-------------------------------------------------------------------

#!/bin/sh

DATE=`date +%b%d-%H%M%S`

OUTDIR=/pdfshare/pdfs

ps2pdf $1 $OUTDIR/$DATE.temp
mv $OUTDIR/$DATE.temp $OUTDIR/$DATE.pdf
rm $1

--------------------------------------------------------

These are mostly the same as yours, except for a few differences i.e. the use of the "nobody" user......

Make sure the permissions to the output directory are then correct..
 
Old 01-26-2004, 05:49 AM   #8
craddy
LQ Newbie
 
Registered: Sep 2003
Posts: 20

Original Poster
Rep: Reputation: 0


Brilliant! It works, for anyone reading this thread then the smb.conf and script above work well!

Thanks loads Adam!

Richard
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba PDF share disappearing antwoneeter Linux - Software 2 10-04-2004 10:49 PM
Samba problem- pdf printer won't work! linux-addict Linux - Networking 3 04-06-2004 02:28 AM
Samba PDF printer AdamPengelly Linux - Networking 8 01-13-2004 01:26 PM
samba print pdf heero82 Linux - Software 0 07-21-2003 09:27 PM
SAMBA PDF Printer Setting heero82 Linux - Software 0 07-18-2003 05:00 AM


All times are GMT -5. The time now is 08:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration