Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cups shutdown is not working cleanly #3679

Closed
michaelrsweet opened this issue Sep 16, 2010 · 6 comments
Closed

Cups shutdown is not working cleanly #3679

michaelrsweet opened this issue Sep 16, 2010 · 6 comments

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.4.4
CUPS.org User: andrea

Cups is compiled with ./configure, make, make install on a standard ubuntu 9.04 installation.

Add a printer, e.g. a socket printer, disconnect the printer and print a testpage.
If now cups is killed or restarted, some thousend backend and some cups processes appear in top, all are zombie processes.

This happens also with cups 1.4.3, but I had no problems with 1.4b1.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: jpopelka

More info with proposed patch is here:
https://bugzilla.redhat.com/show_bug.cgi?id=624441

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: andrea

Thanks a lot, this patch fixes the bug for me.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

The proposed change in bugzilla is no good - we don't want to stop the printer since that change can get unintentionally saved in printers.conf.

An alternate patch is attached which tracks whether we are shutting down and doesn't start new jobs automatically if so.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: jpopelka

Just a small remark.

You misplaced comment
/* Shutting down the scheduler? */
in the second chunk of the patch.

I think you now need to swap comments
/* Shutting down the scheduler? /
and
/
Need to load configuration? */

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: jpopelka

Oh, forget it, I'm wrong.
Each comment belong to the code line above.

@michaelrsweet
Copy link
Collaborator Author

"str3679.patch":

Index: scheduler/job.c

--- scheduler/job.c (revision 9306)
+++ scheduler/job.c (working copy)
@@ -348,7 +348,7 @@
*/

 if (job->state_value == IPP_JOB_PENDING && !NeedReload && !Sleeping &&
  •    !job->printer)
    
  •    !DoingShutdown && !job->printer)
    

    {
    printer = cupsdFindDest(job->dest);
    pclass = NULL;

    Index: scheduler/cupsd.h

    --- scheduler/cupsd.h (revision 9306)
    +++ scheduler/cupsd.h (working copy)
    @@ -153,8 +153,10 @@

    VAR time_t ReloadTime VALUE(0);
    /* Time of reload request... /
    -VAR int NeedReload VALUE(RELOAD_ALL);
    +VAR int NeedReload VALUE(RELOAD_ALL),
    /
    Need to load configuration? */

  •       DoingShutdown   VALUE(0);
    
  •               /\* Shutting down the scheduler? _/
    

    VAR void *DefaultProfile VALUE(0);
    /_ Default security profile */

Index: scheduler/main.c

--- scheduler/main.c (revision 9306)
+++ scheduler/main.c (working copy)
@@ -706,6 +706,8 @@
* Shutdown the server...
*/

  •    DoingShutdown = 1;
    

    cupsdStopServer();

    /*
    

    @@ -736,6 +738,8 @@
    * Startup the server...
    */

  •    DoingShutdown = 0;
    
    • cupsdStartServer();
    /*
    

    @@ -1111,6 +1115,8 @@

    • Close all network clients...
      */
  • DoingShutdown = 1;

cupsdStopServer();

#ifdef HAVE_LAUNCHD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant