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

mdnsctl publish "hangs" #6

Closed
mischapeters opened this issue Mar 28, 2015 · 7 comments
Closed

mdnsctl publish "hangs" #6

mischapeters opened this issue Mar 28, 2015 · 7 comments

Comments

@mischapeters
Copy link

When publishing a service with something like the below command, the prompt never appears again.

root@ap:~ # mdnsctl publish MySite http tcp 80 "WWW"
Group MySite is probing...
Group MySite is announcing...
Group MySite published.

Running openmdns on OpenBSD 5.7 GENERIC#837
Let me know if there is more information I can provide.

@haesbaert
Copy link
Owner

That is the normal behaviour, as long as the control socket is connected from mdnsctl to mdnsd, the service will remain published, if the client (mdnsctl) exits, the service is unpublished. If you want multiple services, just spawn multiple mdnctls.

@mischapeters
Copy link
Author

Any plans to have a switch for mdnsctl to surpress output? Or to be able to use a config file?

@haesbaert
Copy link
Owner

Supressing output should be done with shell redirection I guess.

Being able to use a configuration file would indeed be very welcome. At this time, I'm currently considering rewriting openmdns in ocaml, then adding all this features.

@nxg
Copy link

nxg commented Nov 8, 2017

I'd like to add to this (I know, closed) issue a +1 for the idea of a config file, or at least a non-‘hanging’ interface to publishing services.

The current interface seems unusual/unexpected for a service of this type, and means that I (with reasonably extensive experience on various BDSs and Linuxes) don't have any mental templates for how to configure such a daemon at boot time. A config file would seem best, but if there were even a non-hanging interface to mdnsctl publish then I could invoke a series of such commands in some boot-time script.

I appreciate that the current interaction model has as an advantage, that there is no need for an ‘unpublish’ command.

My remark here is independent of the issue I've just opened (issue #24), concerning the manpage's discussion of this. However that issue may back up how unexpected mdnsctl's behaviour seems to me.

I'll note in passing, that I learned about OpenMDNS from a blog post which shares your dislike of Avahi, but lists ‘Can only be configured at runtime with mdnsctl’ as the only downside of OpenMDNS. Given that that page recommends using mDNSResponder whilst complaining about its almost complete lack of documentation, the implication is that the lack of a config file is a significant downside.

@nxg
Copy link

nxg commented Nov 8, 2017

An afterthought...

If there were a non-hanging interface to publish, then mdnsctl could potentially read a line at a time from an input file, parse it with something very similar to the existing main() function, and thus have something which was effectively a (very readable) config file, more-or-less for free.

The input file might look something like:

# comments ignored, and blanks
publish service-name ...
publish service-name ...

# and potentially other publications
proxy service-name ...

A -f input-file option to mdnsctl would look entirely unsurprising, to me.

@nxg
Copy link

nxg commented Nov 8, 2017

...and also (don't worry – I'll shut up in a minute!)

I should note that, on further investigation, I've just realised that Apple's dns-sd -R command works in the same way as mdnsctl publish, by publishing the record as long as the dns-sd command is running.

For the record, I still think that's a bit... odd, but I feel obliged to acknowledge that mdnsctl isn't being as unusual as I thought it was.

@haesbaert
Copy link
Owner

No worries !

You see it is normal behaviour since the controlling program (mdnsctl) needs to handle states from the daemon.

What we should have is two things:

  • a configuration file for mdnsctl that could express N things to be published.
  • a switch to daemonize mdnsctl.

It makes no sense to add the publishing "client" side to mdnsd, it has to be a controlling program like mdnsctl.

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

3 participants