Bug 116446 - useless cupsd restarts in YaST
Summary: useless cupsd restarts in YaST
Status: RESOLVED FIXED
: 203207 (view as bug list)
Alias: None
Product: openSUSE 11.0
Classification: openSUSE
Component: YaST2 (show other bugs)
Version: Beta 2
Hardware: All Linux
: P5 - None : Major (vote)
Target Milestone: ---
Assignee: Michal Zugec
QA Contact: Johannes Meixner
URL:
Whiteboard: printer
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-12 09:50 UTC by Johannes Meixner
Modified: 2008-08-14 06:11 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 2005-09-12 09:50:50 UTC
An enhancement request for 10.1:

YaST printer config does a lot of cupsd re-starts.
In most cases this is not necessary.

As each spooler re-start disrupts all active printing jobs
(so that they will be re-printed from the beginning),
the YaST printer config tool cannot be used for CUPS servers
which are under a higher load.

The many spooler restarts seem to be a leftover from the time
when we had LPRng because LPRng needs a spooler restart to re-read
/etc/printcap and to set up the matching spool stuff (with "checkpc")
for each changed queue.

In contrast cupsd doesn't need a re-start if queues are changed.
There is no need to re-start cupsd for anything which can be set up
using (only) the "lpadmin" command.

There are only a few cases when cupsd must be re-started:
* when /etc/cups/cupsd.conf was changed
* when /etc/cups/*.types and/or /etc/cups/*.convs were changed
* when backends are changed in /usr/lib[64]/cups/backend/
* when PPD files are changed in /usr/share/cups/model/
The last three items should happen only when software is
installed or removed by the YaST printer config tool.
If the user did such changes manually, he should know
that he must re-start cupsd afterwards.

Nevertheless YaST must check and make sure that cupsd
is running if it is needed:
* when at least one local queue exists
* when the local host should listen to remote CUPS browsing information

When cupsd is started anew and/or when it is re-started,
YaST should show a user confirmation request
to have the user informed and let him decide:
* when a new service is to be started (see bug #115888)
* when a running service will go down and up again
Comment 1 Michal Zugec 2005-10-10 13:12:07 UTC
fixed first part - reduced cups restarts
Comment 2 Johannes Meixner 2006-06-21 10:13:07 UTC
Reopening because of second part and:

A special note regarding HPLIP:

The initial comment reads:
------------------------------------------------------------
cupsd must be re-started
* when backends are changed in /usr/lib[64]/cups/backend/
------------------------------------------------------------

In case of HPLIP it is a bit more special:
It wouldn't help to re-start cupsd after the hplip RPM was installed
because the HP backends "hp" and "hpfax" don't work unless the "hplip"
service is up and running.

Therefore for HPLIP it would be as follows:
cupsd must be re-started after the "hplip" service is up and running
if it was not yet up and running before.
(This condition implies that the hplip RPM is already installed.)

The final goal is to have the HP backends "hp" and "hpfax"
ready to operate in CUPS.
Therefore the best test is to check for those backends dierctly.
In bash I would do it like: 
-----------------------------------------------------------------------------
if lpinfo -v | grep -q '^direct hp:' && lpinfo -v | grep -q '^direct hpfax:'
then echo ok
else rccups restart
fi
-----------------------------------------------------------------------------
Comment 3 Michal Zugec 2006-08-30 06:47:16 UTC
move to later
Comment 4 Michal Zugec 2006-09-01 11:29:21 UTC
reopen
Comment 5 Michal Zugec 2006-09-01 11:29:59 UTC
fixed
Comment 6 Johannes Meixner 2008-05-09 13:34:11 UTC
It still re-starts the cupsd much too often.
Eeach time when it finishes!

There is no re-start of the cupsd needed to add, modify,
or delete print queues.
Only a config change of the cupsd requires it to be re-started.
Comment 7 Johannes Meixner 2008-05-30 06:25:37 UTC
An update regarding comment #2:

Since hplip version 2.8.4 (i.e. since openSUSE 11.0)
there are no longer any daemons.
The hp backend is just a normal backend.
Therefore the special stuff in comment #2 can be ignored
since openSUSE 11.0 so that bug #184798 does no longer
depend on this one.
Comment 8 Michal Zugec 2008-07-06 17:47:18 UTC
*** Bug 203207 has been marked as a duplicate of this bug. ***
Comment 9 Michal Zugec 2008-08-14 06:11:14 UTC
There is new yast2-printer module which fixes most of the bugs. If this problem
occurs in this version, please reopen bugreport.
http://mzugec.blogspot.com/2008/08/new-yast2-printer-configuration-module.html