Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cups-pdf does not work
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
Aquous
l33t
l33t


Joined: 08 Jan 2011
Posts: 647

PostPosted: Sat Feb 04, 2012 10:54 am    Post subject: cups-pdf does not work Reply with quote

From /var/log/cups-pdf_log:
Code:
[DEBUG] switching to new gid (aquous)
[DEBUG] initialization finished (v2.6.1)
[DEBUG] user identified (aquous)
[DEBUG] output directory name generated (/home/aquous)
[DEBUG] user information prepared
[DEBUG] spoolfile name created (/var/spool/cups-pdf/SPOOL/cups2pdf-2864)
[DEBUG] source stream ready
[DEBUG] destination stream ready (/var/spool/cups-pdf/SPOOL/cups2pdf-2864)
[DEBUG] owner set for spoolfile (/var/spool/cups-pdf/SPOOL/cups2pdf-2864)
[DEBUG] using traditional fgets
[DEBUG] found beginning of postscript code (%!PS-Adobe-3.0)
[DEBUG] now extracting postscript code
[DEBUG] found title in ps code ((print.ps))
[DEBUG] found end of postscript code (%%EOF)
[DEBUG] all data written to spoolfile (/var/spool/cups-pdf/SPOOL/cups2pdf-2864)
[DEBUG] trying to use PS title ((print.ps))
[DEBUG] removing trailing newlines from title ((print.ps))
[STATUS] ***Experimental Option: DecodeHexStrings
[DEBUG] checking for hex strings ((print.ps))
[DEBUG] not a hex string, has no start marker ((print.ps))
[DEBUG] removing enclosing parentheses () from full title ((print.ps))
[DEBUG] removing file name extension (.ps)
[DEBUG] calling alternate_replace_string
[DEBUG] removing alternate special characters from title (print)
[DEBUG] title successfully retrieved (print)
[DEBUG] input data read from stdin
[DEBUG] output filename created (/home/aquous/print.pdf)
[DEBUG] ghostscript commandline built (/usr/bin/gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="/home/aquous/print.pdf" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f /var/spool/cups-pdf/SPOOL/cups2pdf-2864)
[DEBUG] output file unlinked (/home/aquous/print.pdf)
[DEBUG] TMPDIR set for GhostScript (/var/tmp)
[DEBUG] waiting for child to exit
[DEBUG] entering child process
[DEBUG] GID set for current user
[DEBUG] supplementary groups set for current user
[DEBUG] UID set for current user (aquous)
[DEBUG] ghostscript has finished (256)
[ERROR] failed to set file mode for PDF file (non fatal) (/home/aquous/print.pdf)
[DEBUG] ERRNO: 2
[DEBUG] no postprocessing
[DEBUG] spoolfile unlinked (/var/spool/cups-pdf/SPOOL/cups2pdf-2864)
[DEBUG] all memory has been freed
[STATUS] PDF creation successfully finished (aquous)

But when I run the supposedly problematic /usr/bin/gs command on my .ps file myself, it works just fine.
How should I be debugging this?
Back to top
View user's profile Send private message
BigBox37
n00b
n00b


Joined: 25 Dec 2010
Posts: 23

PostPosted: Thu Feb 09, 2012 3:20 pm    Post subject: Re: cups-pdf does not work Reply with quote

Aquous wrote:
From /var/log/cups-pdf_log:
Code:
[DEBUG] switching to new gid (aquous)
...

But when I run the supposedly problematic /usr/bin/gs command on my .ps file myself, it works just fine.
How should I be debugging this?


Consider using the standard print to file ability of cups instead of cups-pdf.

Print to file - Output as PDF
http://ompldr.org/vY3B4MA
Back to top
View user's profile Send private message
jlandru
n00b
n00b


Joined: 27 Aug 2003
Posts: 8

PostPosted: Thu Feb 09, 2012 4:18 pm    Post subject: [ERROR] failed to set file mode for PDF file (non fatal) Reply with quote

[ERROR] failed to set file mode for PDF file (non fatal) (/path/to/myfile.pdf)

Error is generated by cups-pdf but is relative to ghostscript rights. Ghostscript seems to need full rights in its temp work dir.

Setting "GSTmp /tmp" instead of "GSTmp /var/tmp" in /etc/cups/cups-pdf.conf solves the problem for me.

hope this can help.

Jacques Landru
Back to top
View user's profile Send private message
penetrode
Apprentice
Apprentice


Joined: 29 Dec 2003
Posts: 249
Location: Calgary, Alberta

PostPosted: Fri Mar 23, 2012 10:42 am    Post subject: Re: [ERROR] failed to set file mode for PDF file (non fatal) Reply with quote

jlandru wrote:
[ERROR] failed to set file mode for PDF file (non fatal) (/path/to/myfile.pdf)

Error is generated by cups-pdf but is relative to ghostscript rights. Ghostscript seems to need full rights in its temp work dir.

Setting "GSTmp /tmp" instead of "GSTmp /var/tmp" in /etc/cups/cups-pdf.conf solves the problem for me.


I get a similar error, but changing GSTmp had no effect. Also, the directories in question already have the necessary permissions:

Code:
1896833 drwxrwxrwt  14 root    root     12K 23. Mär 11:03 tmp


and in /var:

Code:
302516 drwxrwxrwt 10 root root 4,0K 23. Mär 09:19 tmp


Moreover, my error message seems to be saying that the problem is in the spool directory:

Code:
Fri Mar 23 08:30:03 2012  [ERROR] failed to set file mode for PDF file (non fatal) (/var/spool/cups-pdf/root/Test_Page.pdf)


Except that spools always have the appropriate permissions...

is there any way to make this error message more informative?
Back to top
View user's profile Send private message
penetrode
Apprentice
Apprentice


Joined: 29 Dec 2003
Posts: 249
Location: Calgary, Alberta

PostPosted: Fri Mar 23, 2012 11:15 am    Post subject: hilarious Reply with quote

Even with 'LogType=4' set in cups-pdf_log, cups-pdf fails to mention that gs isn't even executing properly:

Code:

Fri Mar 23 11:57:51 2012  [DEBUG] switching to new gid (lp)
Fri Mar 23 11:57:51 2012  [DEBUG] initialization finished (v2.4.8)
Fri Mar 23 11:57:51 2012  [DEBUG] user identified (whumpus)
Fri Mar 23 11:57:51 2012  [DEBUG] output directory name generated (/home/whumpus)
Fri Mar 23 11:57:51 2012  [DEBUG] user information prepared
Fri Mar 23 11:57:51 2012  [DEBUG] spoolfile name created (/var/spool/cups-pdf/SPOOL/cups2pdf-14730)
Fri Mar 23 11:57:51 2012  [DEBUG] source stream ready
Fri Mar 23 11:57:51 2012  [DEBUG] destination stream ready (/var/spool/cups-pdf/SPOOL/cups2pdf-14730)
Fri Mar 23 11:57:51 2012  [DEBUG] owner set for spoolfile (/var/spool/cups-pdf/SPOOL/cups2pdf-14730)
Fri Mar 23 11:57:51 2012  [DEBUG] found beginning of postscript code (%!PS-Adobe-3.0)
Fri Mar 23 11:57:51 2012  [DEBUG] now extracting postscript code
Fri Mar 23 11:57:51 2012  [DEBUG] found title in ps code ((Falser Words Were Never Spoken - NYTimes.com))
Fri Mar 23 11:57:55 2012  [DEBUG] found end of postscript code (%%EOF)
Fri Mar 23 11:57:55 2012  [DEBUG] all data written to spoolfile (/var/spool/cups-pdf/SPOOL/cups2pdf-14730)
Fri Mar 23 11:57:55 2012  [DEBUG] trying to use PS title ((Falser Words Were Never Spoken - NYTimes.com))
Fri Mar 23 11:57:55 2012  [DEBUG] removing trailing newlines from title ((Falser Words Were Never Spoken - NYTimes.com))
Fri Mar 23 11:57:55 2012  [DEBUG] removing enclosing parentheses () from full title ((Falser Words Were Never Spoken - NYTimes.com))
Fri Mar 23 11:57:55 2012  [DEBUG] removing file name extension (.com)
Fri Mar 23 11:57:55 2012  [DEBUG] removing special characters from title (Falser Words Were Never Spoken - NYTimes)
Fri Mar 23 11:57:55 2012  [DEBUG] title successfully retrieved (Falser_Words_Were_Never_Spoken_-_NYTimes)
Fri Mar 23 11:57:55 2012  [DEBUG] input data read from stdin
Fri Mar 23 11:57:55 2012  [DEBUG] output filename created (/home/whumpus/Falser_Words_Were_Never_Spoken_-_NYTimes.pdf)
Fri Mar 23 11:57:55 2012  [DEBUG] ghostscript commandline built (/usr/bin/gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="/home/whumpus/Falser_Words_Were_Never_Spoken_-_NYTimes.pdf" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f /var/spool/cups-pdf/SPOOL/cups2pdf-14730)
Fri Mar 23 11:57:55 2012  [DEBUG] output file unlinked (/home/whumpus/Falser_Words_Were_Never_Spoken_-_NYTimes.pdf)
Fri Mar 23 11:57:55 2012  [DEBUG] TMPDIR set for GhostScript (/var/tmp)
Fri Mar 23 11:57:55 2012  [DEBUG] entering child process
Fri Mar 23 11:57:55 2012  [DEBUG] GID set for current user
Fri Mar 23 11:57:55 2012  [DEBUG] UID set for current user (whumpus)
Fri Mar 23 11:57:55 2012  [DEBUG] ghostscript has finished (32512)
Fri Mar 23 11:57:55 2012  [DEBUG] waiting for child to exit
Fri Mar 23 11:57:55 2012  [DEBUG] spoolfile unlinked (/var/spool/cups-pdf/SPOOL/cups2pdf-14730)
Fri Mar 23 11:57:55 2012  [DEBUG] all memory has been freed


Everything looks fine, right? (Note the absence of any error message.)

Well...

Code:
cups # /usr/bin/gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -sOutputFile="/home/whumpus/Falser_Words_Were_Never_Spoken_-_NYTimes.pdf" -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress -c .setpdfwrite -f /var/spool/cups-pdf/SPOOL/cups2pdf-14730
/usr/bin/gs: error while loading shared libraries: libtiff.so.3: cannot open shared object file: No such file or directory


I wonder why cups-pdf doesn't catch this error and at least log it.
Back to top
View user's profile Send private message
hika
Apprentice
Apprentice


Joined: 13 Mar 2009
Posts: 226
Location: Utrecht

PostPosted: Mon Apr 14, 2014 7:15 pm    Post subject: Reply with quote

Changing the rights on the directory containing the homedirectories (owned by root.users) from 700 to 770 solved it. I have cups-pdf printing to $HOME/pdf-print.

Hika
Back to top
View user's profile Send private message
hika
Apprentice
Apprentice


Joined: 13 Mar 2009
Posts: 226
Location: Utrecht

PostPosted: Mon Apr 14, 2014 7:19 pm    Post subject: Reply with quote

Weirdly enough the home directories themselfs are still on 700!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum