Given a configuration with a Location that is used for unknown terminals and has a printer
And the printer is removed from CUPS
When the user reconnects or logs in
Then the printer should not be available
Currently a printer with that name is re-added to CUPS.
> lpadmin -D testprinter -p testprinter
Add testprinter to a location that is used for unknown terminals.
> lpadmin -x testprinter
Log into ThinLinc from a unknown terminal. Watch the printer be revived:
> lpstat -a
*** Bug 7588 has been marked as a duplicate of this bug. ***
Fixed now. I have verified (on Fedora 32) that the following config..:
> name=samuels workstation
> [/printing/nearest/locations/New location]
.. results in the following log:
> 2020-11-10 14:14:07 INFO vsmserver.extproc: ['/opt/thinlinc/etc/sessionstartup.d/tl-limit-printers'] exited with exit code 0
> 2020-11-10 14:14:07 WARNING vsmserver.extproc: ['/opt/thinlinc/etc/sessionstartup.d/tl-limit-printers'] wrote to stderr: The printer 'asf' for the terminal '00:D8:61:42:02:41' was not found.The printer 'anfshgn' to be used for unknown terminals was not found.
And no printers were added:
> $ sudo lpstat -a
> nearest accepting requests since mån 30 sep 2019 10:31:44
> Office accepting requests since fre 30 okt 2020 13:53:54
> thinlocal accepting requests since ons 3 jun 2020 11:28:35
Created attachment 965 [details]
Hconf for nearest
I can verify that the issue has been fixed. I tested nightly build 6653 on Ubuntu20.04:
* Known terminal with non-existent printer. No printer was added.
* Known terminal at location with non-existent printer. No printer was added.
* Location with non-existent printer used for unknown terminals. No printer was added.
* Location used for unknown terminals, with both existing and non-existing printer. The existing was added but not the other.
So the issue is fixed, but I found that with the conf (see attachment) we log to stderr for each terminal at the location. In a setup with lots of terminals there would be a very long entry in the log if a printer does not exist. The log I got:
> 2020-11-11 10:27:37 WARNING vsmserver.extproc: ['/opt/thinlinc/etc/sessionreconnect.d/tl-limit-printers'] wrote to stderr: The printer 'non-existent' for the terminal '2C:F0:5D:12:0F:2B' was not found.The printer 'non-existent' for the terminal '2C:F0:5D:12:0F:2C' was not found.The printer 'non-existent' for the terminal '2C:F0:5D:12:0F:2A' was not found.The printer 'non-existent' to be used for unknown terminals was not found.
Looks good, closing.
I missed to test the normal case, that all printers exists. The warning is always printed, even when all printers exists:
> 2020-12-08 11:15:41 WARNING vsmserver.extproc: ['/opt/thinlinc/etc/sessionreconnect.d/tl-limit-printers'] wrote to stderr: The following configured printers couldn't be found:
Now it should only log when there's printers that can't be found :)
Indeed, there is no log message when all printers are found. Also tests again with a non existent printers and the warning is printed as expected and the printers are not added.