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
picomdnsd: Add package #1339
Conversation
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>
Helper package for PR #1062 |
init.d script needs improvement and doesn't seem to work properly when enabled during bootup :/ |
How does this compare to umdnsd? |
There was a problem hiding this 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)}') |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
@neheb |
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. |
@neheb |
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. |
umdns (excluding depends) --> 15.9 KB |
can you move this to the feed please ? it should not be inside trunk |
@diizzyy why dont we use umdns ? |
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 :/ |
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