cups-pdf 2.4.6-3ubuntu9 doesn't create PDF-queue

Bug #152293 reported by Claudio
6
Affects Status Importance Assigned to Milestone
cups-pdf (Ubuntu)
Fix Released
Medium
Till Kamppeter

Bug Description

Binary package hint: cups-pdf

The installation/configuration of the package returns no error but it doesn't create the PDF-Printer.

I think the postinst script isn't waiting long enough for cupsys to reload:
'lpstat -r' returns "Unable to connect to server" when I remove '> /dev/null' from the line 'if lpstat -r > /dev/null 2>&1'.

If I comment out the following lines

if [ -f /etc/init.d/cupsys ]
then
 invoke-rc.d cupsys force-reload || invoke-rc.d cupsys start || /bin/true
fi

the script creates the PDF-queue as expected.

Related branches

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Please try the fixed packages on

http://www.linux-foundation.org/~till/tmp/ubuntu/gutsy/cups-pdf/

The fix is trivial (see debdiff), I have simply added a "sleep 3" after the restart of CUPS. So there is no risk putting that into Gutsy.

Changed in cups-pdf:
importance: Undecided → Medium
milestone: none → ubuntu-7.10
status: New → Fix Committed
Revision history for this message
Claudio (cwr) wrote :

Thank you Till - now it's working again

Revision history for this message
Chris Cheney (ccheney) wrote :

Uploaded sitting in approval queue now.

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :
Download full text (4.1 KiB)

cups-pdf (2.4.6-3ubuntu10) gutsy; urgency=low

  * debian/postinst: Before creating a CUPS queue wait 3 seconds to be sure
    that the CUPS daemon is listening (LP: #152293).

cups-pdf (2.4.6-3ubuntu9) gutsy; urgency=low

  * debian/patches/50_default_conf.patch: Withdrawn the chnage of the PDF
    destination to ~/Desktop, returned to ~/PDF, also do not let cups-pdf
    label documents with job numbers by default (see LP bugs 134682 and
    134671).
  * debian/control: Removed the versioned require on cupsys, as we have
    withdrawn the change of the PDF destination.

cups-pdf (2.4.6-3ubuntu8) gutsy; urgency=low

  * debian/patches/50_default_conf.patch: Use ~/Desktop as default destination
    for the PDF files so that users find them more easily (LP: #134682,
    LP: #134671)
  * debian/prerm, debian/postinst: Make any failure of CUPS command line tools
    non-fatal, to not affect the setup of cups-pdf if CUPS crashes immediately
    after being restarted by the cups-pdf setup (LP: #136449, LP: #147974).
  * debian/control: Require cupsys 1.3.2-1ubuntu2 or newer, to have
    AppArmor restrictions allowing to write into ~/Desktop.

cups-pdf (2.4.6-3ubuntu7) gutsy; urgency=low

  * debian/control: Add explicit cupsys-client dependency, since the postinst
    needs 'lpadmin' and cupsys itself only recommends -client.
    (LP: #134453)

cups-pdf (2.4.6-3ubuntu6) gutsy; urgency=low

  * debian/postinst: Fix invocation of "lpstat -r" (remove backticks). This
    makes the automatic setup of the PDF queue actually work again.

cups-pdf (2.4.6-3ubuntu5) gutsy; urgency=low

  * debian/postinst: force PDF queues on localhost only; systems configured
    for remote CUPS servers are not expecting it.

cups-pdf (2.4.6-3ubuntu4) gutsy; urgency=low

  * debian/postinst, debian/prerm: Check, create, or remove PDF queues only
    if the CUPS daemon is running, otherwise go on silently (LP: #133743).

cups-pdf (2.4.6-3ubuntu3) gutsy; urgency=low

  * debian/postinst: Only set up the PDF queue, do not make it the default.
    Otherwise the PDF queue would stay the default when the first real printer
    is detected after installation and as the installation of the packages
    happens before the detection of the printers all systems will have the PDF
    queue as default.

cups-pdf (2.4.6-3ubuntu2) gutsy; urgency=low

  [ Till Kamppeter ]
  * debian/control: Updated dependencies: ghostscript, paperconf.
  * debian/postinst, debian/prerm: Create a PDF print queue when installing
    and take it down when uninstalling (LF: #82674)
  * debian/patches/10_auto_assign_ppd.patch: Make the PPD automatically
    assigned to the PDF printer by CUPS/printer setup tools
  * debian/rules: Enabled the package for applying patches by adding
    "include /usr/share/cdbs/1/rules/simple-patchsys.mk"

  [ Martin Pitt ]
  * Now that we use simple-patchsys.mk, make a proper patch
    debian/patches/01_mkdir_as_user.patch from the src/cups-pdf.c change in
    the last upload. Also move the default configuration changes into a patch
    50_default_conf.patch, so that the diff.gz is now free of upstream diffs.
  * debian/postinst: If paperconf fails, fall back to paper size "a4"...

Read more...

Changed in cups-pdf:
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

I just tested this on a current gutsy amd64 desktop CD install, and there is no PDF queue.

Changed in cups-pdf:
assignee: nobody → till-kamppeter
status: Fix Released → Confirmed
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Proposed fix:

Do not restart CUPS in the maintainer scripts, as after restarting CUPS the daemon is not listening for a certain time and so the maintainer script has no chance to create a CUPS queue. Start CUPS if it was not running yet ("/etc/init.d/cupsys start" only exits if CUPS is really listening).

Changed in cups-pdf:
assignee: till-kamppeter → nobody
milestone: ubuntu-7.10 → gutsy-updates
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Please try the packages on

http://www.linux-foundation.org/~till/tmp/ubuntu/gutsy/cups-pdf/

We simply do not restart CUPS any more before creating the PDF printer, as it is completely unnecassary. Now the printer should reliably get created.

The change is simply and should be made available as an SRU, see debdiff at the same download location.

Revision history for this message
Martin Pitt (pitti) wrote :

On desktop CDs this is broken for all users, because during livefs build, no daemons will ever be started (due to diverting invoke-rc.d). We need to find a solution for this, too.

Revision history for this message
Martin Pitt (pitti) wrote :

Till, can you please prepare a new hardy upload for this?

Changed in cups-pdf:
assignee: nobody → till-kamppeter
milestone: gutsy-updates → none
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Please try these packages:

http://www.linux-foundation.org/~till/tmp/ubuntu/hardy/cups-pdf/

The following changes are done:

- They do not restart CUPS if CUPS is running, so print queue creation will not fall into a time period where CUPS is not listening.
- If CUPS needs to be started, it is started by "/etc/init.d/cupsys start" This call only exits if CUPS is actually listening
- If CUPS is still not running or not even installed the CUPS queue is created by editing config files
- In addition, the package is synced with the latest Debian package

Changed in cups-pdf:
status: Confirmed → Fix Committed
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

cups-pdf (2.4.6-4ubuntu1) hardy; urgency=low

  * Merge from debian unstable, remaining changes:
    - debian/control: "Depends: ghostscript | gs-esp | gs-gpl, libpaper-utils,
      cupsys, cupsys-client", "Suggests: system-config-printer"
    - debian/patches/01_mkdir_as_user.patch: Postpone creation of per-user
      output directory until we setuid()'ed to the user. This both avoids
      nasty mistakes, and also avoids using CAP_DAC_OVERRIDE, so that we
      can tighten cups' apparmor profile.
    - debian/patches/10_auto_assign_ppd.patch: Make the PPD automatically
      assigned to the PDF printer by CUPS/printer setup tools
    - debian/patches/50_default_conf.patch, extra/cups-pdf.conf: Move the
      default configuration changes into a patch 50_default_conf.patch, so
      that the diff.gz is now free of upstream diffs.
    - debian/rules: Enabled the package for applying patches by adding
      "include /usr/share/cdbs/1/rules/simple-patchsys.mk"
    - debian/postinst, debian/prerm: Let PDF print queue being created
      automatically when installing the package and being removed
      automatically when uninstalling the package.
  * debian/postinst, debian/postrm: Restart of CUPS daemon not needed,
    restarting only causes CUPS daemon not listening immediately after
    restart and so the PDF queue not being created. So removed any
    restart of the CUPS daemon from the maintainer script. We only start
    the CUPS daemon if it is not actually running, because we need it
    for having a PDF printer (LP: #152293).
  * debian/postinst: Create CUPS queue by modifying config files in the
    case that the CUPS daemon could not be started or if CUPS is not
    installed.

cups-pdf (2.4.6-4) unstable; urgency=low

  [ Martin Pitt ]
  * debian/postinst: Changed /usr/lib/cups/backend/cups-pdf permissions
    from 4751 (which was still necessary for the non-root CUPS) to 0700
    (in accordance with upstream requirements).
  * debian/postinst: Made /var/spool/cups-pdf/ANONYMOUS sticky, since it
    is world-writeable.

 -- Till Kamppeter <email address hidden> Mon, 19 Nov 2007 15:00:19 +0000

Changed in cups-pdf:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.