This bug was fixed in the package cups - 1.7.1-4ubuntu1
---------------
cups (1.7.1-4ubuntu1) trusty; urgency=low
* cupsd-upstart-support.patch: Allow starting cupsd socket-triggered
through Upstart, for on-demand starting to save resources (especially
on mobile devices, LP: #1276713).
* cupsd-exit-on-idle.patch: Add mode to let cupsd terminate when it is idle,
also for running CUPS on-demand. If the mode is activated, either by
ExitOnIdleTimeout=TIMEOUT in cupsd.conf, by "-x TIMEOUT" on the cupsd
command line or by setting the env variable CUPSD_EXIT_ON_IDLE_TIMEOUT=
TIMEOUT (With TIMEOUT in all theree cases the idle timeout in seconds,
0 turning off the feature, off by default), cupsd terminates when it
is idle (no jobs, no shared printers) for the given timeout.
* cupsd-exit-on-idle-upstart.patch: Set idle timeout of cupsd to 30 sec
if CUPS is started socket-triggered by Upstart and the timeout is not
explicitly set (LP: #1276713).
* airprint-support.patch, pidfile.patch,
do-not-broadcast-with-hostnames.patch, confdirperms.patch,
log-debug-history-nearly-unlimited.patch,
cupsd-set-default-for-SyncOnClose-to-Yes.patch: Refreshed with quilt.
-- Till Kamppeter <[email protected]> Fri, 14 Feb 2014 17:08:01 +0100
** Changed in: cups (Ubuntu)
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to cups in Ubuntu.
https://bugs.launchpad.net/bugs/1276713
Title:
upstart socket activation for cups
Status in Upstart:
Confirmed
Status in “cups” package in Ubuntu:
Fix Released
Bug description:
tkamppeter and I, worked on porting cups to use socket activation.
There were a few issues:
cups by default, binds to "localhost:631" it does it by resolving
localhost and then binding to all IP address there were returned, so
by default it does ::1 and 127.0.0.1.
Once that configuration option is established a list of sockets is
generated, we've modified initialisation to look at UPSTART_FDS
(similar to uwsgi) and replace matching sockets passed to us into the
list.
This appears to work fine, apart from it appeared as if sockets passed
by upstart to us are bound to 0.0.0.0 regardless of the configuration
(or so getsockname tells cups).
Secondly since upstart only gives us one socket, i opted to modify
cups config to explicitely listen on ipv4 127.0.0.1 and disabled the
unix domain socket option, such that clients socket activate cups and
communicate via that socket.
After doing all of the above, we noticed that although cups is started
and is managed by upstart and cups logs indicate that it apparently
has resumed accepting connections.... but there is already a client
connection / request pending which activated cups in the first place.
After inspecting netstat it was apparent that connection has
buffered/unprocessed packets still waiting for a reply. Eventually a
client that socket activated cups timesout and exits, and subsequent
connections work correctly. I believe that we didn't increment "client
connection count" to one in CUPS state-machine or some such.
Following example code within upstart which performs lauchd socket
activation was not useful either, as that code path is clearly buggy,
since it incorrectly checks for error/return codes of getsockname.
I'll attach the state of our patch work to this bug report.
I dislike, how "accepting connections" is paused/resumed and how cups
does dns resolution and thus listens on more connections than
configured to. I think best way to proceed is to instead investigate
and patch unix domain socket activation for cups, as hopefully that is
slightly more reliable from the upstart-socket-bridge.
The bug of not processing the first connection, i presume, is in cups
codebase - unless we are required to replay the messages.
To manage notifications about this bug go to:
https://bugs.launchpad.net/upstart/+bug/1276713/+subscriptions
--
Mailing list: https://launchpad.net/~desktop-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help : https://help.launchpad.net/ListHelp