From owner-freebsd-ports@FreeBSD.ORG Wed Sep 1 13:16:31 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AE02516A4CE; Wed, 1 Sep 2004 13:16:31 +0000 (GMT) Received: from smtp07.web.de (smtp07.web.de [217.72.192.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4788443D2D; Wed, 1 Sep 2004 13:16:31 +0000 (GMT) (envelope-from a_wittig@web.de) Received: from [83.129.177.123] (helo=[192.168.0.94]) by smtp07.web.de with asmtp (TLSv1:RC4-MD5:128) (WEB.DE 4.101 #44) id 1C2UyT-0008SQ-00; Wed, 01 Sep 2004 15:16:29 +0200 Message-ID: <4135CBAA.5080902@web.de> Date: Wed, 01 Sep 2004 15:16:26 +0200 From: Alexander Wittig User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; de-AT; rv:1.7) Gecko/20040616 X-Accept-Language: de, en, fr MIME-Version: 1.0 To: alfred@freebsd.org Content-Type: multipart/mixed; boundary="------------010900000605080005030003" Sender: a_wittig@web.de X-Sender: a_wittig@web.de cc: ports@FreeBSD.org Subject: small contribution to net/mDNSResponder X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Sep 2004 13:16:31 -0000 This is a multi-part message in MIME format. --------------010900000605080005030003 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi there I tried to set up a daap server yesterday (for Apples iTunes) and I couldn't get net/howl working from the ports. so I compiled audio/daapd without Howl and used net/mDNSResponder as mentioned in the daapd readme. That readme states that one should call mDNSResponder with some command line parameters to have it announce the existence of the daap server to the other Rendezvous-aware members of the .local network. This way has some disadvantages: (1) You can only announce one single service, (2) you have to start it manually. To overcome those problems I wrote a startup script for the mDNSResponderPosix binary. It uses the new rc.d framework (thus depends on sysutil/rc_subr) and supports a config file that can hold any number of services to be announced. To allow comments in the config file I had to make a small change in the source code of mDNSResponderPosix. I included my Config (you may want to delete the actual service definitions and only use the samples on top), the rc.d script, and a diff of the mDNSposix/Responder.c file in the mDNSResponder source tree (version 62) with this email. Maybe you want to include it in the port so that other users who want to set up a system similar to mine can do so easily. Cheers, Alex BTW: What is mdnsd (installed by the mDNSResponder port) good for? It doesn't seem to have a man page or config file nor did I find anything in the Apple documentation. Also it didn't want to announce my daap server, so had to just kick it ;-) --------------010900000605080005030003 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="mDNSResponderPosix.conf" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mDNSResponderPosix.conf" # mDNSResponderPosix configuration File # # This file contains the services to be announced to other Rendezvous aware # machines on the .local network # # Entries constist of four consecutive lines as follows: # NAME OF SERVICE # TYPE OF SERVICE (and, if different from .local, the domain seperated by a space) # TXT RECORD (short description of service) # PORT OF SERVICE # # Example (announce existence of Apache to the .my_local world): # My Webserver # _http._tcp. .my_local. # This is my Apache server # 80 # MP3-Server _daap._tcp. Alex MP3-Server 3689 Lokaler Webserver _http._tcp. Lokaler Webserver auf Server 80 MySQL Datenbank _mysql._tcp. MySQL Datenbank auf Server 3306 SSH Serverzugang _ssh._tcp. SSH Serverzugang (VORSICHT) 22 NTP Zeitserver _ntp._udp. NTP Zeitserver auf Server 123 --------------010900000605080005030003 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="mDNSResponderPosix.sh" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mDNSResponderPosix.sh" #!/bin/sh # PROVIDE: mDNSResponderPosix # REQUIRE: DAEMON # KEYWORD: FreeBSD shutdown # Define these mDNSResponderPosix_* variables in one of these files: # /etc/rc.conf # /etc/rc.conf.local # /etc/rc.conf.d/mDNSResponderPosix # # DO NOT CHANGE THESE DEFAULT VALUES HERE # mDNSResponderPosix_enable="YES" mDNSResponderPosix_flags="" . /usr/local/etc/rc.subr name="mDNSResponderPosix" rcvar=`set_rcvar` prefix=/usr/local logdir=/var/log mDNSResponderPosixBin="${prefix}/bin/mDNSResponderPosix" mDNSResponderPosixCfg="${prefix}/etc/mDNSResponderPosix.conf" mDNSResponderPosixLog="${logdir}/mDNSResponderPosix.log" required_files="${mDNSResponderPosixCfg}" command="${mDNSResponderPosixBin}" command_args="-b -f ${mDNSResponderPosixCfg} ${mDNSResponderPosix_flags} >> ${mDNSResponderPosixLog} 2>&1" load_rc_config $name run_rc_command "$1" --------------010900000605080005030003 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="Responder.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="Responder.c.diff" 652a653,657 > // Skip comments > if( ch == '#' || ch == ';' ) > do { > ch = fgetc( fp ); > } while( ch != EOF && ch != '\n' && ch != '\r' ); 658c663 < // Read three lines, check them for validity, and register the service. --- > // Read four lines, check them for validity, and register the service. --------------010900000605080005030003--