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

D-Bus listener #63

Open
ismell opened this issue Oct 27, 2020 · 2 comments
Open

D-Bus listener #63

ismell opened this issue Oct 27, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@ismell
Copy link

ismell commented Oct 27, 2020

Samba uses the avahi-client/D-Bus to announce to avahi that a the server is available. WSDD currently relies on the rc system to ensure samba is started before wsdd.

wsdd could subscribe to the same messages that avahi listens for and then publish the service. This would allow wsdd to start before smbd and then when smbd is ready, it could announce the share. This would also have the advantage that if smbd dies, wsdd could remove the service.

@christgau christgau added the enhancement New feature or request label Dec 17, 2020
@christgau
Copy link
Owner

christgau commented Feb 21, 2021

IMO integrating D-Bus directly in wsdd appears to be show-stopper. There is hardly any way to do so without having hard dependencies on some kind of D-Bus library. This is something I really don't like to have.

My current approach to react on Samba's D-Bus notifications in wsdd would be the following:

  1. wsdd's existing "API" gets an extension that allows to enable and disable the host role. The API interface must be enabled explicitly. The current implementation of the API s*cks because the Python's TcpServer handles "requests" s*cks, i.e. it closes the connection to the client as soon as after a single request is handled. I intent to rewrite the networking code but that's a different story.
  2. Any kind of "glue application" can then use the API to enable and disable the host discovery dynamically at runtime without having the privilege to stop/start the service.
  3. One possible glue application might a D-Bus listener that handles announcements of Samba via D-Bus and controls wsdd accordingly. Such a "wsdd-dbus" (working title) application might be part of the wsdd package but a separate code base.
  4. In the same way "wsdd-dbus" can be used to provide information about discovered hosts via D-Bus to other applications as desired in D-Bus API for clients? #56.

Does that sound like a possible solution?

christgau added a commit that referenced this issue May 1, 2021
Start and stop commands allow to control network the networking
activities without starting and stopping the program.

see #63
@alexpevzner
Copy link

Hi,

sorry for probably out of date comment.

Actually this is better not to subscribe to D-Bus messages that Avahi uses for its client/server communications, but instead, acting as Avahi client (I believe, Avahi client library for Python does exist), browse for the _smb._tcp service announces on DNS-SD that match the local host addresses.

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

No branches or pull requests

3 participants