zero-conf in Unix [cont’d]

I found that the mDNSResponderPosix port does what I want by providing the notification and discovery layer for zeroconf-enabled clients and publishing client services with the addition of a config file: with that running, I can make daap work on FreeBSD and play with other services (Terminal.app will look for and connect to ssh, sftp, and telnet servers through zeroconf)…. none 22 red:ftp _ftp._tcp none 21 Rendezvous Browser tells the tale: The shell script below seems to work: improvements welcome.

As often happens when one reboots a system infrequently, services that were started by hand don’t always come up automatically. In my case, my rendezvous/zeroconf configuration didn’t come back and I had to revisit how I had set up some months back. I found that the mDNSResponderPosix port does what I want by providing the notification and discovery layer for zeroconf-enabled clients and publishing client services with the addition of a config file: with that running, I can make daap work on FreeBSD and play with other services (Terminal.app will look for and connect to ssh, sftp, and telnet servers through zeroconf). The config file syntax is simple:
red:www
_http._tcp
path=/
80

Celestial Jukebox
_daap._tcp.
/opt/music
3689

red:ssh
_ssh._tcp.
none 22

red:ftp
_ftp._tcp
none
21

Rendezvous Browser tells the tale: Rendezvous The shell script below seems to work: improvements welcome.


#!/bin/sh

# stolen from 'greenstripe'(a/k/a Manfred Heindl) on the MacOSXhints.com website
# this is only part of what I 'borrowed.'

# mDNSResponder
MDNS_RESPONDER_EXEC='/usr/local/bin/mDNSResponderPosix'
MDNS_RESPONDER_LOGFILE='/var/log/mDNSResponder.log'
MDNS_RESPONDER_PIDFILE='/var/run/mDNSResponder.pid'
MDNS_RESPONDER_CMDLINE=' -bf'
MDNS_RESPONDER_CONFFILE=' /etc/rendezvous.conf'

case "$1" in
start)
if [ -x "${MDNS_RESPONDER_EXEC}" ]; then
${MDNS_RESPONDER_EXEC} ${MDNS_RESPONDER_CMDLINE} ${MDNS_RESPONDER_CONFFILE} >> ${MDNS_RESPONDER_LOGFILE}
echo -n ' mDNS Responder'
fi
;;
stop)
killall mDNSResponder 2>/dev/null
if [ $? -ne 0 ] ;
then echo 'mDNSResponder not started'
fi
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo ""
echo "Usage: `basename $0` { start | stop | restart }"
echo ""
exit 64
;;
esac

Leave a Reply

Your email address will not be published. Required fields are marked *