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

run nqptp as non root #12

Closed
th0u opened this issue Nov 27, 2021 · 4 comments
Closed

run nqptp as non root #12

th0u opened this issue Nov 27, 2021 · 4 comments

Comments

@th0u
Copy link

th0u commented Nov 27, 2021

Hi,
thank you for your excellent work.

Today I installed shairport-sync with AirPlay2 support.
According the documentation, nqptp (must) run as root.
Why is this?
I assume this is due to listening to ports < 1024.

After creation of a user / group nqptp and patching nqptp.service (replace root by nqptp) and running this command:

setcap 'cap_net_bind_service=+ep' /usr/local/bin/nqptp

nqptp runs as user nqptp and I was able to stream from my MBP2020 macOS12 to shairport-sync.

udp        0      0 0.0.0.0:9000            0.0.0.0:*                           2702/nqptp           off (0.00/0/0)
udp        0      0 0.0.0.0:319             0.0.0.0:*                           2702/nqptp           off (0.00/0/0)
udp        0      0 0.0.0.0:320             0.0.0.0:*                           2702/nqptp           off (0.00/0/0)
udp6       0      0 :::9000                 :::*                                2702/nqptp           off (0.00/0/0)
udp6       0      0 :::319                  :::*                                2702/nqptp           off (0.00/0/0)
udp6       0      0 :::320                  :::*                                2702/nqptp           off (0.00/0/0)

nqptp     2702  1.8  0.0   2212   460 ?        SLs  19:20   0:13 /usr/local/bin/nqptp`

I am not sure how I can verify that nqptp is definitely working, but I observed that when nqptp is stopped that I can not stream from iPhone nor from macOS. If I then start nqptp then it's possible to stream from macOS12. So I assume nqptp is working while not running as root.

Any other hints to verify functionality running nqptp as non root?

TIA, T

edit: streaming from iOS is also not possible when nqptp was stopped. This seems to be expected.

@mikebrady
Copy link
Owner

Thanks. Yes, the only motivation was for access to ports below 1024. If you can run nqptp with the argument -v, it’ll log some information so you can see that it’s working.

@th0u
Copy link
Author

th0u commented Nov 27, 2021

Thnx for your feedback. I can confirm that nqptp is working. The setup above (setcap...) survives reboot.
Btw I tested this on raspbian bullseye.

@mikebrady
Copy link
Owner

I'll close this, if that's okay?

@th0u
Copy link
Author

th0u commented Dec 8, 2021

yes sure. Thank you for your excellent work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants