Bug 637455 - gutenprint: run cups-genppdupdate in RPM post-install
Summary: gutenprint: run cups-genppdupdate in RPM post-install
Status: RESOLVED FIXED
Alias: None
Product: openSUSE 11.4
Classification: openSUSE
Component: Printing (show other bugs)
Version: Factory
Hardware: All openSUSE 12.2
: P3 - Medium : Normal (vote)
Target Milestone: Factory
Assignee: Johannes Meixner
QA Contact: Johannes Meixner
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-07 08:47 UTC by Johannes Meixner
Modified: 2014-07-30 13:55 UTC (History)
1 user (show)

See Also:
Found By: Development
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Meixner 2010-09-07 08:47:42 UTC
See "Regarding CUPS PPD files" in
https://bugzilla.novell.com/show_bug.cgi?id=514994#c9

The README file in the Gutenprint sources reads:
-------------------------------------------------------------------
If you attempt to use a version of Gutenprint with PPD files
not built for that precise version, the driver will fail
-------------------------------------------------------------------
so that existing print queues must be re-setup in any case
(or the special tool "...genppdupdate..." can be used but
I wonder what is easier for a normal user in the end).

Robert Krawitz, the main-author of Gutenprint suggested
to run cups-genppdupdate in RPM post-install:
-----------------------------------------------------------------------
From: Robert Krawitz
Cc: gimp-print-devel@lists.sourceforge.net
Subject: ... How to compile Gutenprint with DefaultPageSize A4 ?
...
My suggestion would be for the RPM package to have a post-install that
runs cups-genppdupdate.  If you think that that's too big of a hammer,
or that you want some way of distinguishing between PPD files you
supply and those produced by another copy of Gutenprint, we can
suggest solutions.  cups-genppdupdate is designed to be really simple
and should be a lot easier than destroying and re-creating queues (and
getting all the options right).
-----------------------------------------------------------------------
Comment 1 Johannes Meixner 2010-09-07 09:36:06 UTC
Perhaps a precondition is that cups-genppdupdate
may also have to run o.k. during full-system-upgrade-time
when the actually upgraded system is not up-and-running
(in particular no cupsd is running) i.e. when the system upgrade
happens from an install-system (running in the RAM) and the
actually upgraded system files are only mounted somewhere.
Comment 2 Johannes Meixner 2010-09-24 10:01:24 UTC
I have now this RPM postinstall script
-------------------------------------------------------------------------------
%post
/sbin/ldconfig
# update quietly Gutenprint PPD files in /etc/cups/ppd/ if such PPD files exist
# using the new PPD files under /usr/share/cups/model/gutenprint/ as templates
# see https://bugzilla.novell.com/show_bug.cgi?id=637455
/usr/sbin/cups-genppdupdate -q || /bin/true
# send CUPS daemon SIGHUP to let it recognize new and updated PPD files:
if test -x /etc/init.d/cups && /etc/init.d/cups status >/dev/null
then /etc/init.d/cups reload >/dev/null || /bin/true
fi
# exit successfully in any case:
exit 0
-------------------------------------------------------------------------------
which should not cause any issue regardless in which environment it runs. 

Furthermore I removed gutenprint-5.2.6-make_A4_DefaultPageSize.patch
because it is useless because the DefaultPageSize in the PPD
templates in /usr/share/cups/model/ does not matter because
the cupsd sets the DefaultPageSize for PPDs in /etc/cups/ppd/
by default according to the locale that the cupsd runs in or
according to a DefaultPaperSize entry in /etc/cups/cupsd.conf.

Submitted gutenprint to its devel project "Printing" via submitrequest 49024
and forwarded this to openSUSE:Factory via submitrequest 49027.
Comment 3 Johannes Meixner 2013-01-22 08:36:36 UTC
Sending CUPS daemon SIGHUP has really bad side effects
in the running system when a print job is active:
----------------------------------------------------------------------------
# echo -e 'one \ftwo\fthree' | lp -d hplaserjet1220hpcups ; \
  sleep 1 ; /etc/init.d/cups reload
request id is hplaserjet1220hpcups-33

# lpstat -p hplaserjet1220hpcups
printer hplaserjet1220hpcups disabled since Tue Jan 22 09:26:50 2013 -
        /usr/lib/cups/backend/hp failed

# grep PID /var/log/cups/error_log
I ... [Job 33] Started filter /usr/lib/cups/filter/texttops (PID 13825)
I ... [Job 33] Started filter /usr/lib/cups/filter/pstops (PID 13826)
I ... [Job 33] Started filter /usr/lib/cups/filter/gstoraster (PID 13827)
I ... [Job 33] Started filter /usr/lib/cups/filter/hpcups (PID 13828)
I ... [Job 33] Started backend /usr/lib/cups/backend/hp (PID 13829)
E ... PID 13829 (/usr/lib/cups/backend/hp) crashed on signal 1.
E ... PID 13828 (/usr/lib/cups/filter/hpcups) crashed on signal 1.
E ... PID 13827 (/usr/lib/cups/filter/gstoraster) crashed on signal 1.
D ... PID 13825 (/usr/lib/cups/filter/texttops) exited with no errors.
D ... PID 13826 (/usr/lib/cups/filter/pstops) exited with no errors.
----------------------------------------------------------------------------

It must be possible to install gutenprint in the running system
when a print job is active without causing arbitrary print jobs
to fail and without causing arbitrary print queues to become disabled.

Therefore I must remove sending CUPS daemon SIGHUP in gutenprint.spec.
Comment 4 Johannes Meixner 2013-01-23 11:23:17 UTC
Submitted gutenprint to "Printing" via submitrequest 149673
and forwarded it to openSUSE:Factory as submitrequest 149674
with RPM changelog text:
----------------------------------------------------------------------------
- Do no longer send SIGHUP to cupsd in RPM post install script
  (which would let the cupsd recognize new and updated PPD files
   see the entry dated "Fri Sep 24 10:45:28 CEST 2010" below)
  because SIGHUP to cupsd makes active print jobs fail
  (see bnc#637455 starting at comment#3).
- Added explicit "Requires: ghostscript" if suse_version > 1210
  because since openSUSE 12.2 cups only "Recommends: ghostscript"
  (to avoid a build dependency cycle) so that gutenprint needs
  an explicit "Requires: ghostscript" for the "cups" device in
  Ghostscript that is required by "rastertogutenprint" (compare
  the entry dated "Thu Apr 28 17:20:03 CEST 2011" below).
----------------------------------------------------------------------------
Comment 5 Bernhard Wiedemann 2013-01-23 12:00:09 UTC
This is an autogenerated message for OBS integration:
This bug (637455) was mentioned in
https://build.opensuse.org/request/show/149674 Factory / gutenprint
Comment 6 Johannes Meixner 2013-03-08 15:12:13 UTC
Same for m2300w:

Fixed m2300w in "Printing" and forwarded it
to openSUSE:Factory as submitrequest 158019
with RPM changelog text:
----------------------------------------------------------------------------
- Do no longer send SIGHUP to cupsd via RPM post install script
  (which would let the cupsd recognize new and updated PPD files)
  because SIGHUP to cupsd makes active print jobs fail
  (see bnc#637455 starting at comment#3).
----------------------------------------------------------------------------
Comment 7 Bernhard Wiedemann 2013-03-08 16:00:09 UTC
This is an autogenerated message for OBS integration:
This bug (637455) was mentioned in
https://build.opensuse.org/request/show/158019 Factory / m2300w
Comment 8 Johannes Meixner 2014-07-30 13:55:58 UTC
FYI:
See the related more general issue bnc#889591
"RPMs that provide new printing filters do not restart cupsd"