Univention Bugzilla – Bug 55264
New printers take a long time to show up in samba
Last modified: 2023-02-01 17:24:17 CET
In a customer environment, it takes up to more than an hour, since the printer shows up. In my simple testenvironment I could reproduce this, but it took only 7 minutes, which is still too long. This can be watched with the printmanagement in windows, but also with rpcclient -c "enumprinters" -UAdministrator%univention localhost on the server. So the administration (assigning Windows drivers, setting default settings) is not userfriendly at all, or you can say, it is blocking the daily work. The has occurred since samba 4.16 in UCS 5
Additional information came up Meanwhile, a deleted printer just won't disappear from Samba. It's out of CUPS, it's out of all Samba configs in /etc/samba/, but it still shows up occasionally in printmanagent.msc and co. The whole thing is so bizarre that yesterday the customer wanted to show all printers of the server 3 times in a row (so within <3 seconds) on a client in Powershell with the "Get-Printer" cmdlet, and sometimes the deleted printer was shown, and sometimes not. Locally on the server with rpcclient it is shown to me also still Logfile is in the ticket 2022101121000353 #6
Did you check if any of the following things help? * /etc/init.d/samba restart * smbcontrol smbd reload-config * smbcontrol smbd reload-printers * The last two commands also accept a pid instead of "smbd", you may check smbstatus to narrow down the smbd child pids
(In reply to Arvid Requate from comment #3) > Did you check if any of the following things help? > > * /etc/init.d/samba restart > * smbcontrol smbd reload-config > * smbcontrol smbd reload-printers > * The last two commands also accept a pid instead of "smbd", > you may check smbstatus to narrow down the smbd child pids In my testenvironment none of this worked to get the printers immediately with watch rpcclient -c enumprinters -UAdministrator%univention localhost
Created attachment 11003 [details] smbcontrol-reload-config.diff This change fixed it on my test system. But still, it's weird.
It's this process that needs a nudge: smbcontrol samba-bgqd reload-config
Could it be that the `smbcontrol` lies in different locations on new-installed and upgraded systems? At least we have: 19 times in /var/log/univention/listener.log: https://jenkins2022.knut.univention.de/job/UCS-5.0/job/UCS-5.0-2/job/AutotestUpgrade/SambaVersion=no-samba,Systemrolle=slave/ws/test/listener.log Traceback (most recent call last): File "/usr/lib/univention-directory-listener/system/cups-printers.py", line 388, in handler reload_smbd() File "/usr/lib/univention-directory-listener/system/cups-printers.py", line 419, in reload_smbd subprocess.call(('/usr/bin/smbcontrol', 'all', 'reload-config')) File "/usr/lib/python3.7/subprocess.py", line 323, in call with Popen(*popenargs, **kwargs) as p: File "/usr/lib/python3.7/subprocess.py", line 775, in __init__ restore_signals, start_new_session) File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/smbcontrol': '/usr/bin/smbcontrol' 87 times in /var/log/univention/listener.log: https://jenkins2022.knut.univention.de/job/UCS-5.0/job/UCS-5.0-2/job/AutotestUpgrade/SambaVersion=no-samba,Systemrolle=slave/ws/test/listener.log Traceback (most recent call last): File "/usr/lib/univention-directory-listener/system/cups-printers.py", line 457, in postrun reload_smbd() File "/usr/lib/univention-directory-listener/system/cups-printers.py", line 419, in reload_smbd subprocess.call(('/usr/bin/smbcontrol', 'all', 'reload-config')) File "/usr/lib/python3.7/subprocess.py", line 323, in call with Popen(*popenargs, **kwargs) as p: File "/usr/lib/python3.7/subprocess.py", line 775, in __init__ restore_signals, start_new_session) File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/smbcontrol': '/usr/bin/smbcontrol'
af1ca46eaf | Only do samba operations if tools are present e69327993a | Advisory update
OK: Service samba-bgqd is reloaded OK: Yaml Verified
<https://errata.software-univention.de/#/?erratum=5.0x563>