Page 1 of 1

[SOLVED] printer-driver-cups-pdf in Bookworm

Posted: 2023-06-12 03:35
by ramack
I upgraded (yes it is an upgrade, not and update!) from Bullseye to Bookworm last night. It went very smoothly, no issues at all. After most major dist-upgrades, typically I'll have to mess with cups-pdf to work "my way". Two of those things being, 1) pre-fixing the job ID, 2) Change the output directory from the default {HOME}/PDF/ to {HOME}/Documents/cups-pdf.

I had been able accomplish this by editing edit /etc/cups/cups.conf and changing the label option from 0 to 1, and modify the output path. It appears now that due to apparmor, cups.conf and apparmor profile both need to be edited.

From the Bookworm package page
https://packages.debian.org/bookworm/pr ... r-cups-pdf
Documents are written to a configurable directory (by default to ~/PDF) or can be further manipulated by a post-processing command.
Note that AppArmor prevents outputting PDF documents to non-default directories so </etc/apparmor.d/usr.sbin.cupsd> must also be edited, whenever the above default get changed in </etc/cups/cups-pdf.conf>.

/etc/apparmor.d/usr.sbin.cupsd doesn't exist, do I need to create it? The statement "must also be edited" implies it is created during apt-get install of the package. However, usr.sbin.cupsd.dpkg-dist does exist.

The last section of this file has
# allow read and write on almost anything in @{HOME} (lenient, but
# private-files-strict is in effect), to support customized "Out"
# setting in cups-pdf.conf (Debian#940578)
#include <abstractions/private-files-strict>
@{HOME}/[^.]*/{,**/} rw,
@{HOME}/[^.]*/** rw,

Which my understanding is that no modification to usr.sbin.cupsd.dpkg-dist is necessary.

So I'm a bit confused what needs editing in order to accomplish my two "tweaks" to customize the output path and filename format.

Rich

Re: printer-driver-cups-pdf in Bookworm

Posted: 2023-06-12 09:56
by fabien
ramack wrote: 2023-06-12 03:35/etc/apparmor.d/usr.sbin.cupsd doesn't exist
It should

Code: Select all

$> apt-file search "/etc/apparmor.d/usr.sbin.cupsd"
cups-daemon: /etc/apparmor.d/usr.sbin.cupsd
ramack wrote: 2023-06-12 03:35However, usr.sbin.cupsd.dpkg-dist does exist.
From 5.2.3. Checksums, List of Configuration Files, et al.
dpkg behaves as intelligently as possible: if the standard configuration file has not changed between the two versions, it does nothing. If, however, the file has changed, it will try to update this file. Two cases are possible: either the administrator has not touched this configuration file, in which case dpkg automatically installs the new version; or the file has been modified, in which case dpkg asks the administrator which version they wish to use (the old one with modifications, or the new one provided with the package). To assist in making this decision, dpkg offers to display a “diff” that shows the difference between the two versions. If the user chooses to retain the old version, the new one will be stored in the same location in a file with the .dpkg-dist suffix. If the user chooses the new version, the old one is retained in a file with the .dpkg-old suffix.
You probably said no when asked whether to use the maintainer new file. You can safely

Code: Select all

#> mv -i /etc/apparmor.d/usr.sbin.cupsd.dpkg-dist /etc/apparmor.d/usr.sbin.cupsd

Re: printer-driver-cups-pdf in Bookworm

Posted: 2023-06-12 13:19
by ramack
Yes, I did. And thinking that this would have caused the issue, I
apt-get purge printer-driver-cups-pdf
apt-get install printer-driver-cups-pdf
When asked which conf to use, this time I had the maintainer's conf applied. No effect, /etc/apparmor.d/usr.sbin.cupsd doesn't exist. I'll run the command you posted and report back with the results.

I've had similar "issues" before when updating/upgrading cups-pdf and have been able to resolve the job ID position in the filename by changing the setting in CUPS. Making the changes in CUPS also works this time as well.
viewtopic.php?p=749375&hilit=CUPS+PDF#p749375

Re: printer-driver-cups-pdf in Bookworm

Posted: 2023-06-12 13:34
by ramack
Running

Code: Select all

#> mv -i /etc/apparmor.d/usr.sbin.cupsd.dpkg-dist /etc/apparmor.d/usr.sbin.cupsd
and then editing
/etc/cups/cups-pdf.conf
to have the output go to
{HOME}/cups-pdf/
has no effect.

Re: [SOLVED] printer-driver-cups-pdf in Bookworm

Posted: 2023-06-12 21:58
by ramack
Hm...not sure what the issue was but it appears to be working now. I've marked it as solved.

I'm now able to print PDFs to {HOME}/cups-pdf/.