Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not configure samba printer #532

Open
gjask opened this issue Jan 30, 2024 · 17 comments
Open

Can not configure samba printer #532

gjask opened this issue Jan 30, 2024 · 17 comments
Labels
bug Something isn't working f39 Related to Fedora 39 kinoite Also affect Fedora Kinoite upstream Issue reported, fixed or related to upstream projects

Comments

@gjask
Copy link

gjask commented Jan 30, 2024

Describe the bug
tl; dr: CUPS web console misses option to add new printer via SAMBA on Silverblue

At my workplace we have this network printer we connect using SAMBA. For past seven years I always configure this printer using web console natively provided by CUPS (http://localhost:631) because in comparison to gnome-settings it always works like a charm. Gnome-settings have changed many times its printers configuration dialogues in that time yet there is always some problem preventing to configure this particular printer (could not connect samba, could not load custom printer driver, could not handle samba auth, etc.) .

Today I tried to configure this printer in same way on my new laptop for which I decided to switch to Silverblue and I could not because CUPS web console misses option to add samba printer. I spun up Workstation in Boxes to check if that is also an issue there, but it seems to be Silverblue related.

To Reproduce
Please describe the steps needed to reproduce the bug:

  1. Open http://localhost:631 in browser
  2. Navigate to Administration and authenticate with your system account
  3. Click on Add Printer in Printers paragraph
  4. Try to chose Windows Printer via SAMBA

Expected behavior
Option Windows Printer via SAMBA is offered and working

Screenshots
Silverblue:
Snímek obrazovky z 2024-01-30 17-59-43

Workstation:
Snímek obrazovky z 2024-01-30 17-59-04

OS version:

State: idle
BootedDeployment:
● fedora:fedora/39/x86_64/silverblue
                  Version: 39.20240129.0 (2024-01-29T05:35:53Z)
               BaseCommit: bdd0afb451c1768bf872aa30c7d6ee5767f72fd75a75275a54a75f6b30804b61
             GPGSignature: Valid signature by E8F23996F23218640CB44CBE75CF5AC418B8E74C
      RemovedBasePackages: libavfilter-free libavformat-free libpostproc-free libswresample-free libavutil-free libswscale-free libavcodec-free 6.0.1-2.fc39
                           mesa-va-drivers 23.3.3-1.fc39 nano-default-editor 7.2-4.fc39
          LayeredPackages: adw-gtk3-theme ffmpeg gnome-tweaks htop langpacks-cs
                           mesa-va-drivers-freeworld rpmfusion-free-release
                           rpmfusion-nonfree-release tilix vim-default-editor wl-clipboard
@gjask gjask added the bug Something isn't working label Jan 30, 2024
@travier
Copy link
Member

travier commented Jan 30, 2024

This is because we don't have samba in Siverblue. This is related to #320.

I think we should re-consider including it.

@travier travier added the f39 Related to Fedora 39 label Jan 30, 2024
@gjask
Copy link
Author

gjask commented Jan 30, 2024

This is because we don't have samba in Siverblue.

That's actually first thing I considered but I also did quick check and it seemed not be the issue.

# Silverblue
jask@silverbook:~$ rpm -qa | grep samba
samba-common-4.19.4-3.fc39.noarch
samba-client-libs-4.19.4-3.fc39.x86_64
samba-common-libs-4.19.4-3.fc39.x86_64
samba-client-4.19.4-3.fc39.x86_64

# Workstation
jask@fedora:~$ rpm -qa | grep samba
samba-common-4.19.4-3.fc39.noarch
samba-common-libs-4.19.4-3.fc39.x86_64
samba-client-libs-4.19.4-3.fc39.x86_64
samba-client-4.19.4-3.fc39.x86_64

Of course it doesn't mean some other required package that is part of Workstation is not part of Silverblue. But I thought there should be functional/package parity between Workstation and Silverblue, shouldn't it?

EDIT: If somebody knows what package it is that I am missing, please let me know. I will gladly layer it.

@gjask
Copy link
Author

gjask commented Jan 31, 2024

After poking around for some time I was able to come up with cause to this issue. According to CUPS docs there should be /usr/lib/cups/backend/smb symlink pointing to smbspool. I've confirmed it enables configuring SAMBA printer by creating this symlink in usroverlay.

This symlink is present in Workstation installation but is missing in Silverblue. I tracked the missing file to this line in samba CUPS package: https://src.fedoraproject.org/rpms/cups/blob/f39/f/cups.spec#_550

I am not sure why this doesn't get applied in Silverblue, because samba-client seems to be present.

@gjask
Copy link
Author

gjask commented Jan 31, 2024

This could be related to coreos/rpm-ostree#1180

@travier
Copy link
Member

travier commented Jan 31, 2024

Nice investigation, this looks like the issue indeed. Not sure if we have a good path forward. Firsts step would be to confirm if we have SAMBA or not in Silverblue by default right now.

@travier travier added upstream Issue reported, fixed or related to upstream projects kinoite Also affect Fedora Kinoite labels Jan 31, 2024
@gjask
Copy link
Author

gjask commented Jan 31, 2024

Nice investigation, this looks like the issue indeed. Not sure if we have a good path forward.

I think there should be two options. Either implement %triggerin support in rpm-ostree. Or refactor spec file for cups to not need it.

Second option probably will be easier and faster to implement. However it doesn't prevent similar issues in future.

Firsts step would be to confirm if we have SAMBA or not in Silverblue by default right now.

I am not sure how to properly confirm it. To me it seems that same samba packages are part of Silverblue as are installed in Workstation. And those in Workstation are sufficient for this to work.

Edit: I am sorry if I sometimes sound rude. I don't mean to. I just want to be helpful.

@gjask
Copy link
Author

gjask commented Jan 31, 2024

Firsts step would be to confirm if we have SAMBA or not in Silverblue by default right now.

It seems we do: https://pagure.io/workstation-ostree-config/blob/f39/f/fedora-common-ostree-pkgs.yaml#_151

@LorbusChris
Copy link

LorbusChris commented Jan 31, 2024

Couldn't (or shouldn't really) this symlink be shipped as a tmpfiles config snippet? The %%triggerin section could then just be systemd-tmpfiles --create. Might have other ramifications, but might also be worth opening a PR for on the spec to discuss with the RPM maintainers.

@travier
Copy link
Member

travier commented Feb 1, 2024

Could you clarify how we could fix that with tmpfiles?

I've made a temporary workaround in https://pagure.io/workstation-ostree-config/pull-request/456. @gjask can you confirm that the paths are correct? Thanks

@gjask
Copy link
Author

gjask commented Feb 1, 2024

I've made a temporary workaround in https://pagure.io/workstation-ostree-config/pull-request/456. @gjask can you confirm that the paths are correct? Thanks

This looks like it should work for most use-cases. But it would likely break for people who would want to layer and use samba-krb5-printing. I think correct symlink is the one the original trigger tries to create. It should be as follows

ln -snf /usr/libexec/samba/cups_backend_smb /usr/lib/cups/backend/smb

Apart from that it seems it should work. Thank you. :)

@travier
Copy link
Member

travier commented Feb 1, 2024

Thanks for the review. I've updated the PR.

@travier
Copy link
Member

travier commented Feb 1, 2024

I've merged the PR for Rawhide and I'm backporting this in F39 in https://pagure.io/workstation-ostree-config/pull-request/458

I'll merge it soon so that's in the next update. Can you test it tomorrow and report back? Thanks!

@gjask
Copy link
Author

gjask commented Feb 2, 2024

@travier It seems to be working to the point I am able to add the printer as expected. I still am not able to print, but for now it seems to be unrelated problem as same happens on current Workstation. I'll look into it more.

@travier
Copy link
Member

travier commented Feb 2, 2024

Thanks for the update! I'll keep this one open to track this issue.

karuboniru pushed a commit to karuboniru/karuboniru-workstation that referenced this issue Feb 2, 2024
RPM %triggerin are not currently supported in rpm-ostree, thus work
around this issue by manually creating the symlink.

According to the docs, `/usr/lib/cups/backend/smb` should point to `smbspool`.
Here we have the following chain:

/usr/lib/cups/backend/smb -> /usr/libexec/samba/cups_backend_smb -> /etc/alternatives/cups_backend_smb -> /usr/bin/smbspool

See: https://www.cups.org/blog/2005-06-17-printing-to-windows-servers-with-samba.html
See: coreos/rpm-ostree#1180
See: fedora-silverblue/issue-tracker#532
@LorbusChris
Copy link

The following tmpfiles config dropin should create the symlink:

#Type Path             Mode User Group Age  Argument
L+   /usr/lib/cups/backend/smb  -   -   -   -  /usr/libexec/samba/cups_backend_smb

It'd be auto-created on next reboot or when systemd-tmpfiles --create is run e.g. in %%triggerin

@travier
Copy link
Member

travier commented Feb 2, 2024

Not sure I understand. You can not write to /usr on Silverblue. How would that be conditioned to having both cups & samba installed?

@LorbusChris
Copy link

ah right, nevermind this isn't going to work then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working f39 Related to Fedora 39 kinoite Also affect Fedora Kinoite upstream Issue reported, fixed or related to upstream projects
Projects
None yet
Development

No branches or pull requests

3 participants