apple / cups

Apple CUPS Sources
https://www.cups.org
Apache License 2.0
1.93k stars 464 forks source link

CUPS Проблема с отменой подписки по RSS #5973

Open Tarzan142 opened 3 years ago

Tarzan142 commented 3 years ago

Добрый день, имеется CUPS вот на ubuntu. Создаются сами по себе подписки по RSS 50 c лишним штук. при наличии 25 принтеров. эти подписки очееень сильно тормозят капс. При очистке содержимого файлов файлов subscriptions.conf,subscriptions.conf.O, сервер работает шустро (время переключения вкладок веб версии капса стало 1 сек вместо 8-9 секунд, но при печати любого документа с любого принтера создается вновь 50 с лишним подписок RSS. В чем дело, подскажите?. Думал дело в каком-то принтере, удалил все под чbстую, но подписки так и создаются. Ubuntu 18.04.3, CUPS 2.2.7, все принтеры удалял под 0, после печати на любой из принтеров все подписки 50 + появляются вновь. Файл subscriptions.conf: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Subscription configuration file for CUPS v2.2.7 Written by cupsd NextSubscriptionId 405 <Subscription 349> Events printer-state-changed printer-restarted printer-shutdown printer-stopped$ Owner Имя пользователя LeaseDuration 86400 Interval 0 ExpirationTime 1633013711 NextEventId 15851 И так далее: 50 шт. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Мой конфиг: LogLevel warn PageLogFormat MaxLogSize 1m Listen localhost:631 Listen /run/cups/cups.sock Browsing Off BrowseLocalProtocols dnssd DefaultAuthType Basic WebInterface Yes

Order allow,deny <Location /admin> Order allow,deny <Location /admin/conf> AuthType Default Require user @SYSTEM Order allow,deny <Location /admin/log> AuthType Default Require user @SYSTEM Order allow,deny

JobPrivateAccess default JobPrivateValues default SubscriptionPrivateAccess default SubscriptionPrivateValues default Order deny,allow Require user @OWNER @SYSTEM Order deny,allow AuthType Default Require user @SYSTEM Order deny,allow AuthType Default Require user @SYSTEM Order deny,allow Require user @OWNER @SYSTEM Order deny,allow Order deny,allow JobPrivateAccess default JobPrivateValues default SubscriptionPrivateAccess default SubscriptionPrivateValues default AuthType Default Order deny,allow AuthType Default Require user @OWNER @SYSTEM Order deny,allow AuthType Default Require user @SYSTEM Order deny,allow AuthType Default Require user @SYSTEM Order deny,allow AuthType Default Require user @OWNER @SYSTEM Order deny,allow Order deny,allow JobPrivateAccess default JobPrivateValues default SubscriptionPrivateAccess default SubscriptionPrivateValues default AuthType Negotiate Order deny,allow AuthType Negotiate Require user @OWNER @SYSTEM Order deny,allow AuthType Default Require user @SYSTEM Order deny,allow AuthType Default Require user @SYSTEM Order deny,allow AuthType Negotiate Require user @OWNER @SYSTEM Order deny,allow Order deny,allow

MaxClients 10000

michaelrsweet commented 3 years ago

(Sorry, I don't speak/write Russian, but was able to translate via Google...)

If you can enable debug logging (cupsctl --debug-logging), wait for some of the subscriptions to be created, and then attach a copy of your /var/log/cups/error_log file, we might be able to help you determine the cause.

Tarzan142 commented 3 years ago

Good afternoon, thanks for your responsiveness, sorry for my english :). My log: error_log.zip

Thanks

michaelrsweet commented 3 years ago

@Tarzan142 OK, so I don't see any subscriptions getting created. By chance, did you stop the CUPS service before cleaning out the subscriptions.conf file? You need to do that, otherwise CUPS won't see that the subscriptions have been removed.

Tarzan142 commented 3 years ago

I stop the cups (service cups stop), clear the subscription.conf and subscription.conf.O file, start the cups (service cups start), check no subscriptions on RSS (it works quickly), but after the page has been printed(when printing any of 26 printers), all 50 subscriptions of the sets and very much slow down the cups.

Tarzan142 commented 3 years ago

Log after cleaning subscription.conf. error_log_clean_sub.zip

Tarzan142 commented 3 years ago

In the archive error_log_clean_sub.zip do not like these lines, their value reaches just 50 + D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetArray: notify_time_interval[1]=\"0\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetArray: notify_subscription_id[1]=\"2\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetVariable: SERVER_NAME=\"localhost\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetVariable: CUPS_VERSION=\"CUPS v2.2.7\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetArray: notify_lease_duration[2]=\"86400\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetArray: notify_time_interval[2]=\"0\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetArray: notify_subscription_id[2]=\"3\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetVariable: SERVER_NAME=\"localhost\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetVariable: CUPS_VERSION=\"CUPS v2.2.7\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetArray: notify_lease_duration[3]=\"86400\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetArray: notify_time_interval[3]=\"0\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetArray: notify_subscription_id[3]=\"4\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetVariable: SERVER_NAME=\"localhost\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetVariable: CUPS_VERSION=\"CUPS v2.2.7\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetArray: notify_lease_duration[4]=\"86400\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetArray: notify_time_interval[4]=\"0\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetArray: notify_subscription_id[4]=\"5\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetVariable: SERVER_NAME=\"localhost\" D [01/Oct/2021:19:59:14 +0300] [CGI] cgiSetVariable: CUPS_VERSION=\"CUPS v2.2.7\" ........................................................................................................................

zdohnal commented 3 years ago

Hi @Tarzan142 ,

the newest log doesn't show any Create-Subscription either :( . The logs you showed in the previous comment happens always after Get-Subscriptions operation, and it goes from admin CGI script, which asks for subscriptions when showing the main admin page - probably because of RSS, which is removed in the latest CUPS.

It would be great if you tried the following:

  1. stop cups
  2. clean up /etc/cups/subscriptions.conf*
  3. set DirtyCleanInterval 0 in /etc/cups/cupsd.conf (this will cause writing down new subscriptions into subscriptions.conf ASAP - it will narrow the interval of capturing logs)
  4. start catching the logs $ tail -f /var/log/cups/error_log &> current_log.txt
  5. start cups
  6. print a job
  7. go to the Admin page of CUPS Web UI
  8. check whether subscriptions.conf has the new subs - if it does, stop capturing logs by ctrl+c.

After that, please attach current_log.txt as attachment here.

Thank you in advance!