Welcome to the new location of Alien's Wiki, sharing a single dokuwiki install with the SlackDocs Wiki.

Welcome to Eric Hameleers (Alien BOB)'s Wiki pages.

If you want to support my work, please consider a small donation:

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:talk:slackware:cups [2010/02/14 13:50] 84.134.2.190wiki:talk:slackware:cups [2016/07/07 05:58] (current) – [Discussion about printing with CUPS in Slackware] 87.114.234.103
Line 1: Line 1:
 ===== Discussion about printing with CUPS in Slackware ===== ===== Discussion about printing with CUPS in Slackware =====
  
-Hi Erik, thanks for this guide! But I got it working only after 
-I did a chmod 755 on /usr/lib/cups/backend/pdf. 
- --- Jens 
-------------------------------------------------------- 
  
 Please leave your constructive comments on this page.\\  Please leave your constructive comments on this page.\\ 
  --- Eric  --- Eric
 ------------------------------------------------------- -------------------------------------------------------
 +I have question. I don't understand how CUPS works.
  
-In Slackware 12 with CUPS 1.3.7 I found setting the pdf script to save the file did not work as expected. It appears the script is run as user lp, which cannot change the owner. Rather than remove the sticky bit, I used "sudo chown" to change the owner, of course that meant the following "chmod" failed, so I had to swap the two command. I also wanted to record the title of the pdf, so I added three lines to the script. That part of the script now looks like this-+The path appears to be:
  
 + usb://EPSON/Stylus%20SX100?serial=KQEZ387420&interface=1.
 +
 +This path is not a true path from the hard drive, such as /dev../.../ etc.
 +
 +Can someone explain?
 +==== Ownership ====
 +
 +In Slackware 12 with CUPS 1.3.7 I found setting the pdf script to save the file did not work as expected. It appears the script is run as user lp, which cannot change the owner. Rather than remove the sticky bit, I used "sudo chown" to change the owner, of course that meant the following "chmod" failed, so I had to swap the two command. I also wanted to record the title of the pdf, so I added three lines to the script. That part of the script now looks like this: -
  
 <code>''## Normally the PDF file will be emailed to the creating user. <code>''## Normally the PDF file will be emailed to the creating user.
Line 31: Line 36:
  
 Is there a better way to achieve the same results? Is there a better way to achieve the same results?
 +
 +=== Another Possibility ===
 +
 +(This is still the case in Slackware 13.37, with CUPS 1.4.6.)
 +
 +I'm using the following, instead:
 +
 +<code>chmod 775 /var/spool/pdf
 +chown lp:lp /var/spool/pdf</code>
 +
 +and making sure that the users I want to have access to the printed PDFs are in group lp.
 +
 +This does mean that multiple users on my system could access my PDF prints, so there are still security implications.
 +
 ------------------------------------------------------- -------------------------------------------------------
 +==== Permissions ====
 +
 +> Hi Erik, thanks for this guide! But I got it working only after
 +> I did a chmod 755 on /usr/lib/cups/backend/pdf.
 +>  --- Jens
 +
 +Yes you are right. Cups used to run as root (I wrote this article for Slackware 10) but modern cups processes run as user "''lp''". The script needs to be owned by user "''lp''" or it needs to be "''chmod 755''". I've fixed the article, thanks.\\ --- Eric, //Sun Feb 14 21:49:47 UTC 2010//
 +
 +-------------------------------------------------------
 +
 +==== PDF Update for 14.0 and CUPS 1.5.4 ====
 + 
 +The issue of saving the file, instead of mailing it, and copying it to a user's directory has popped up again in 14.0, with a slight variation to what Eric writes above.  As Eric says, the pdf file in /var/spool/cups is owned by lp:lp (and also with the executable bit set -- I modified the script so that the permission is 600, not 700).  It seems the latest CUPS has changed permissions so that having /usr/lib/cups/backend/pdf owned by lp now longer works.  The ''chown'' within the script is failing again.
 +
 +According to the CUPS docs [[http://www.cups.org/documentation.php/doc-1.6/api-filter.html#PERMISSIONS|here]], "Backends that must run as root //[ed: needed for the ''chown'']// should use permissions of 0500 - read and execute by root, no access for other users."  So I have reverted back to that.
 +
 +I changed the pdf backend script permissions to 0700 owned by root:lp and the script as is works fine, including any command at the end to move the pdf file out of the spool directory into your home directory.  No need to add users to groups or other work.
 Discussion about printing with CUPS in Slackware ()
SlackDocs