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-polld doesn't notice if the cups it was logging stderr messages to goes away #2640

Closed
michaelrsweet opened this Issue Dec 21, 2007 · 3 comments

Comments

Projects
None yet
1 participant
@michaelrsweet
Copy link
Collaborator

michaelrsweet commented Dec 21, 2007

Version: 1.3-current
CUPS.org User: jp107

Currently if cupsd is killed by something which means it doesn't clean up child polld processes then the cups-pollds carry on running.

(actually in our case cupsd just died/crashed but it could have been violently killed with the same effect).

Running strace/truss on the cups-polld shows it still trying to send messages to stderr which reports EPIPE (here at least other OSs may be different), but those errors arn't checked for. It is also still sending the update messages to the udp socket but those arn't easy to error check.

On starting a new cupsd it launches it's own cups-polld children so the old ones arn't needed anyway.

I think it should be sagfe to add a check for ferror(stderr) and/or foef(stderr) in the main loop and terminate if the parent has gone away.

This is (obviously) very very low priority 'cos it doesn't stop anything from actually working, it would take a long time for the extra load to become a problem and really cupsd shouldn't just die...

-- Jon

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Dec 21, 2007

CUPS.org User: mike

Reassigning as a low-priority bug against CUPS 1.3.x - this needs to be fixed, even if it is a small bug.

Thanks for the report!

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Jan 8, 2008

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

michaelrsweet commented Jan 8, 2008

"str2640.patch":

Index: scheduler/cups-polld.c

--- scheduler/cups-polld.c (revision 7178)
+++ scheduler/cups-polld.c (working copy)
@@ -144,7 +144,7 @@

  • Loop forever, asking for available printers and classes...
    */
  • for (http = NULL;;)
  • for (http = NULL; !ferror(stderr);)
    {
    /*
  • Open a connection to the server...
    @@ -180,6 +180,8 @@
    if (remain > 0 && !restart_polling)
    sleep(remain);
    }
    +
  • return (1);
    }

@michaelrsweet michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.