Subject: Re: net/mDNSResponder suggestion
To: Matthias Scheler <tron@zhadum.org.uk>
From: Daniel Eggert <eggert@macvaerk.dtu.dk>
List: tech-pkg
Date: 04/19/2007 10:07:32
On Apr 18, 2007, at 3:30 PM, Matthias Scheler wrote:

> On Tue, Apr 17, 2007 at 04:28:19PM +0200, Daniel Eggert wrote:
>>> Why does it have to be started before "DAEMON"?
>>
>> Doesn't. My wrong.
>>
>> Perhaps
>>
>> # REQUIRE: named9
>>
>> would make sense, though?
>
> No, why? Both NetBSD's and pkgsrc's BIND startup script provide  
> "named",
> not "named9". And I can't see a reason why "dnsextd" has to be started
> before the other daemons. So "REQUIRE: DAEMON" is the correct  
> dependence.
>
> "named" is handled differently because a lot of daemons depend on it
> (at least if the machine is its own DNS server).
>
>> I found two other problems:
>>
>> 1) Shutting down dnsextd. Seems like named9 needs to be shut down  
>> only
>> after dnsextd has been shut down.
>
> Neither NetBSD's nor pkgsrc's BIND startup script terminate BIND on
> system shutdown. If it would terminate BIND it would do that after
> everything which depends on "DAEMON".
>
>> 2) dnsextd doesn't terminate on my NetBSD 3.1 box unless I send a
>> SIGKILL to it.
>
> That's a bug in the Apple code which for some reason blocks a lot of
> signals including SIGTERM. The "howl" package has a similar problem.
>
> You can work arround that by adding "sig_stop=KILL" to your
> startup script.

Thanks for all the feedback. I guess this incorporates you suggestions:

#!/bin/sh
#
#

# PROVIDE: dnsextd
# REQUIRE: SERVERS
# REQUIRE: DAEMON

. /etc/rc.subr

name="dnsextd"
rcvar="${name}"
command="/usr/pkg/sbin/${name}"
dnsextd_user?="named"
dnsextd_group?="named"
dnsextd_nice="15"
sig_stop=KILL

load_rc_config "$rcvar"
run_rc_command "$1"


/Daniel