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

picomdnsd: Add package #1339

Closed
wants to merge 1 commit into from
Closed

picomdnsd: Add package #1339

wants to merge 1 commit into from

Conversation

diizzyy
Copy link
Contributor

@diizzyy diizzyy commented Aug 29, 2018

Import picomdnsd which is a tiny mdns daemon to help users find
their device when using DHCP

Signed-off-by: Daniel Engberg daniel.engberg.lists@pyret.net

Import picomdnsd which is a tiny mdns daemon to help users find
their device when using DHCP

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
@diizzyy
Copy link
Contributor Author

diizzyy commented Aug 29, 2018

Helper package for PR #1062

@diizzyy
Copy link
Contributor Author

diizzyy commented Aug 29, 2018

init.d script needs improvement and doesn't seem to work properly when enabled during bootup :/

@neheb
Copy link
Contributor

neheb commented Aug 29, 2018

How does this compare to umdnsd?

Copy link
Contributor

@EricLuehrsen EricLuehrsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start. Could use service_triggers(), START=19 (wrt. Netifd), and 'if [ BOOT -eq 1 ] ;` as we see in dnsmasq, dchpd, and Unbound packages.

USE_PROCD=1

APPBINARY=/usr/sbin/picomdnsd
LANIPADDR=$(/sbin/ifconfig "br-lan" | grep "inet " | awk -F' ' '{print substr($2,6)}')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes br-lan is the interface name and only interface. Should probably have uci with list option for bonded logical interface names (lan, wan, guest) as seen in network uci. Source /lib/functions/network to decompose their IP.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried using UCI but it can't determine IP when it's set to use DHCP, perhaps I'm missing something?

root@OpenWrt:~# uci get network.lan.ipaddr
uci: Entry not found

As you can tell, I'm not very good at init.d scripting at all ;-)

@@ -0,0 +1,14 @@
#!/bin/sh /etc/rc.common

START=99
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

service_triggers() can eliminate most race conditions better than start order 99.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm struggling with finding documentation on how it works (and examples), any pointers?


start_service() {
procd_open_instance
procd_set_param command "$APPBINARY" openwrt "$LANIPADDR"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont you want the hostname as found in UCI system with default openwrt only if empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good idea, would this be a good idea?
uci get system.@system[0].hostname

@diizzyy
Copy link
Contributor Author

diizzyy commented Aug 29, 2018

@neheb
To be honest, I didn't know about umdns. In terms of size it's about half so might be worth the effort? I have no issue with dropping picomdnsd however.

@neheb
Copy link
Contributor

neheb commented Aug 29, 2018

umdnsd has better integration with OpenWrt and procd (a few packages use procd_add_mdns).

Enabling DHCP by default will work for >8MB devices but may be problematic for 4MB.

@diizzyy
Copy link
Contributor Author

diizzyy commented Aug 29, 2018

@neheb
https://openwrt.org/docs/guide-developer/mdns
I can't really make out what I'm supposed to do if I just want to announce the device itself

@bobafetthotmail
Copy link
Contributor

Enabling DHCP by default will work for >8MB devices but may be problematic for 4MB.

Imho it's not a big issue if they remain with static IP, they are legacy after all and got trimmed down in their subtargets "tiny" already.

@diizzyy
Copy link
Contributor Author

diizzyy commented Aug 29, 2018

8815 Aug 29 08:11 bin/packages/powerpc_464fp/base/picomdnsd_2017-03-01-3e5912cb-1_powerpc_464fp.ipk (using -O2, it's about 2k smaller with -Os)

umdns (excluding depends) --> 15.9 KB
http://downloads.lede-project.org/snapshots/packages/powerpc_464fp/base/

@dedeckeh dedeckeh added the core packages pull request/issue for core (in-tree) packages label Sep 6, 2018
@blogic
Copy link
Contributor

blogic commented Sep 10, 2018

can you move this to the feed please ? it should not be inside trunk

@blogic blogic closed this Sep 10, 2018
@diizzyy
Copy link
Contributor Author

diizzyy commented Sep 10, 2018

@blogic
Well, given the ongoing discussion regarding #1062 and the desire to have a device easily discoverable what are you suggesting to use? I would like to get some kind of pointer/opinion.

@blogic
Copy link
Contributor

blogic commented Sep 10, 2018

@diizzyy why dont we use umdns ?

@diizzyy
Copy link
Contributor Author

diizzyy commented Sep 10, 2018

I don't mind as long as someone wont pull the size > * argument (picomdnsd is considerably smaller in that regard). Some documentation about umdns usage would be helpful however :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core packages pull request/issue for core (in-tree) packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants