When built without DBUS-option, cupsd-daemon will begin consuming 100% CPU upon startup. The log-messages say, repeatedly: E [30/Jul/2016:14:49:54 -0400] File "/opt/libexec/cups/notifier/dbus" not available: No such file or directory W [30/Jul/2016:14:49:54 -0400] Notifier for subscription 14 (dbus://) went away, retrying!
I cannot reproduce this. cupsd built without DBUS starts just fine here and consumes no CPU. I suspect you may have the cups_browsed service enabled. That uses D-Bus to communicate with cupsd.
(In reply to Tijl Coosemans from comment #1) > cupsd built without DBUS starts just fine here and consumes no CPU Was dbus installed on the build-machine at build-time? > I suspect you may have the cups_browsed service enabled. How would I check that? Thanks!
(In reply to Mikhail Teterin from comment #2) > Was dbus installed on the build-machine at build-time? Yes, but in the stage directory nothing (except etc/dbus-1/system.d/cups.conf but that's irrelevant) matches dbus so it was disabled correctly. > How would I check that? Do you have cups-filters installed? Is there cups_browsed_enable=YES in /etc/rc.conf? Check with 'ps xa | grep cups' or maybe 'service cups_browsed status'.
(In reply to Tijl Coosemans from comment #3) > > Was dbus installed on the build-machine at build-time? > Yes, but in the stage directory nothing (except etc/dbus-1/system.d/cups.conf > but that's irrelevant) matches dbus so it was disabled correctly. Sorry, I do not understand the above reply... In my case dbus was installed normally, when the build of cups was performed. I suspect, some dbus-related setting in cups gets turned on by this mere presence... > Do you have cups-filters installed? Yes. > Is there cups_browsed_enable=YES in /etc/rc.conf? No. > Check with 'ps xa | grep cups' 689 - Is 1:54,46 /opt/sbin/apcupsd --kill-on-powerfail 815 - Is 0:00,44 /opt/sbin/cupsd -C /opt/etc/cups/cupsd.conf -s /opt/ 8112 - I 0:00,02 /opt/libexec/cups/notifier/dbus dbus:// The first line is unrelated. The last line uses the dbus-notifier in question -- I had to rebuild cups with DBUS-enabled. > or maybe 'service cups_browsed status'. % service cups_browsed status Cannot 'status' cups_browsed. Set cups_browsed_enable to YES in /etc/rc.conf or use 'onestatus' instead of 'status'. % service cups_browsed forcestatus cups_browsed is not running.
> Sorry, I do not understand the above reply... In my case dbus was > installed normally, when the build of cups was performed. Same here. > I suspect, some dbus-related setting in cups gets turned on by this > mere presence... I doubt this, because of what I said. When you build the cups port and then go into /usr/ports/print/cups/work/stage and run 'grep -Ril dbus *' nothing comes up. No binary calls any dbus function or tries to start PREFIX/libexec/cups/notifier/dbus. > 8112 - I 0:00,02 /opt/libexec/cups/notifier/dbus dbus:// This notifier isn't started in my case. I suspect it is only started when something asks cupsd to be notified of events via D-Bus. I know that cups-browsed does this, but if you're not running that it must be something else. Is there anything D-Bus related in your CUPS configuration (grep -Ril dbus PREFIX/etc/cups)? Do you have any additional printer drivers installed like print/hplip?
(In reply to Tijl Coosemans from comment #5) > Is there anything D-Bus related in your CUPS configuration (grep -Ril dbus PREFIX/etc/cups Yes, I found it mentioned in /opt/etc/cups/subscriptions.conf: Recipient dbus:// But that file is very recent and seems to be auto-generated by cups: # Subscription configuration file for CUPS v2.1.3 # Written by cupsd on 2016-07-30 14:35 > Do you have any additional printer drivers installed like print/hplip? Not hplip, but there are cups-filters and foomatic. And KDE's print-manager.
(In reply to Mikhail Teterin from comment #6) > Yes, I found it mentioned in /opt/etc/cups/subscriptions.conf: > > Recipient dbus:// > > But that file is very recent and seems to be auto-generated by cups: subscriptions.conf(5) manpage says that file describes active event subscriptions. Is there anything in there about what requested the dbus subscription? Can you attach this file to the bug? Possibly, you can stop cupsd, rename this file and then restart it. > Not hplip, but there are cups-filters and foomatic. And KDE's print-manager. Those shouldn't be a problem.
Created attachment 173421 [details] subscriptions.conf (In reply to Tijl Coosemans from comment #7) Here is the July 30 version of the file. After I moved it aside and restart cupsd, the new file had no obviously significant differences: --- /tmp/subscriptions.conf 2016-07-30 14:35:27.619776000 -0400 +++ /opt/etc/cups/subscriptions.conf 2016-08-08 16:26:32.064756000 -0400 -# Subscription configuration file for CUPS v2.1.3 -# Written by cupsd on 2016-07-30 14:35 -NextSubscriptionId 15 -<Subscription 14> +# Subscription configuration file for CUPS v2.1.4 +# Written by cupsd on 2016-08-08 16:26 +NextSubscriptionId 18 +<Subscription 17> @@ -10,2 +10,2 @@ -ExpirationTime 1469906310 -NextEventId 1881 +ExpirationTime 1470689777 +NextEventId 39 Hope, this helps.
It recreated the dbus:// subscription with DBUS option disabled?
(In reply to Tijl Coosemans from comment #9) > It recreated the dbus:// subscription with DBUS option disabled? No. I had to enable the DBUS option in order to have a functional system. So it recreated the dbus:// subscription with DBUS option _enabled_. But without an obvious need for it...
The cause could be KDE print manager after all. I didn't think it would be the cause because I also use KDE and have it installed. I've never actually used it though and now that I check the code it does use the CUPS D-Bus notifier. The code is in print/kde4-print-manager/work/print-manager-4.14.3/libkcups/KCupsConnection.cpp. Did you setup the printer via KDE print manager? Maybe you can go without DBUS option if you set it up via the CUPS manager at http://localhost:631 instead.
(In reply to Tijl Coosemans from comment #11) I observe the run-away cupsd right after boot -- before anyone even logs-in and starts an X-session. I don't think, KDE's print-manager is active in any way at that time...
(In reply to Mikhail Teterin from comment #12) I suspect that at shutdown the KDE subscription is still active (maybe only sometimes) and then at boot cupsd tries to restore it. When you install cups without DBUS option you'll have to stop cupsd, clean up subscriptions.conf (or remove it) and then restart cupsd. I don't know if KDE print manager can work without D-Bus support though.
A commit references this bug: Author: tijl Date: Thu Jan 12 16:33:13 UTC 2017 New revision: 431282 URL: https://svnweb.freebsd.org/changeset/ports/431282 Log: The return value of cupsdStartProcess is zero on error. Fix two cases where this is checked incorrectly. PR: 211465 Changes: head/print/cups/Makefile head/print/cups/files/patch-scheduler_client.c head/print/cups/files/patch-scheduler_subscriptions.c
I had another look at this and committed a fix. Just a single error message will be logged now when cupsd attempts to send an event to a notifier that is unavailable.