Re: How to get djbdns to start early enough to satisfy ntpd at boot?

2009-02-03 Thread Brian Reichert
On Fri, Jan 16, 2009 at 12:23:18AM +1100, Jan Mikkelsen wrote:
> Well, the other alternative is to ditch ntpd and go to clockspeed the way 
> djb intended ...

Or, patch ntpd's scripts to be driven by daemontools; something
I've been planning on myself...

(Yes, late reply, sorry...)

> Regards,
> 
> Jan
-- 
Brian Reichert  
55 Crystal Ave. #286Daytime number: (603) 434-6842
Derry NH 03038-1725 USA BSD admin/developer at large
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: How to get djbdns to start early enough to satisfy ntpd at boot?

2009-01-16 Thread Ben Morrow
Quoth Andrew Reilly :
> On Thu, Jan 15, 2009 at 12:00:01PM +, Ben Morrow wrote:
> > 
> > and I also have a /usr/local/etc/rc.d/dnscache which looks like
> [snip]
> > 
> > and a /usr/local/etc/svc.subr as attached. It's somewhat more general
> > than is needed for dnscache, as I also use it to start qmail.
> 
> Wow, those scripts are an extremely cool integration of the
> rcorder framework and the svscan framework.  Could these be
> incorporated into the daemontools and djbdns ports as permanent
> goodness?

Well, it's hardly up to me :). I was wondering about submitting a patch
to the appropriate ports; if you want to preempt me, feel free :). (The
files would presumably need appropriate copyright and license lines
added, of course.)

Ben

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: How to get djbdns to start early enough to satisfy ntpd at boot?

2009-01-15 Thread Andrew Reilly
On Thu, Jan 15, 2009 at 12:00:01PM +, Ben Morrow wrote:
> Quoth Andrew Reilly :
> > 
> > So: does anyone know how to modify the boot-time order so that
> > svscan starts at (or before) the point in the boot cycle where
> > BIND would, on other systems?  I suspect that it should be

> I have, in my svscan.sh,
> 
> # PROVIDE: svscan
> # REQUIRE: SERVERS cleanvar
> 
> and I also have a /usr/local/etc/rc.d/dnscache which looks like
[snip]
> 
> and a /usr/local/etc/svc.subr as attached. It's somewhat more general
> than is needed for dnscache, as I also use it to start qmail.
> 
> Basically: the PROVIDE: named line is needed to get dnscache up before
> ntpd, and the REQUIRE: LOGIN line needs to be changed.

Wow, those scripts are an extremely cool integration of the
rcorder framework and the svscan framework.  Could these be
incorporated into the daemontools and djbdns ports as permanent
goodness?  I'll give them a try-out myself, pronto.  (Might also
investigate clockspeed, per Jan's suggestiong, too.)

Cheers,

Andrew
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: How to get djbdns to start early enough to satisfy ntpd at boot?

2009-01-15 Thread Jan Mikkelsen

Hi,

Andrew Reilly wrote:

I've been a happy djbdns+tinydns user for many, many years.  I
want to keep using it, so answers of the form "bletch!  Use ISC
BIND the way BSD intended" will be ignored :-)

...

Well, the other alternative is to ditch ntpd and go to clockspeed the way 
djb intended ...


Regards,

Jan

:-)

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: How to get djbdns to start early enough to satisfy ntpd at boot?

2009-01-15 Thread Peter Pentchev
On Thu, Jan 15, 2009 at 07:22:39AM -0500, Maxim Khitrov wrote:
> On Thu, Jan 15, 2009 at 12:14 AM, Andrew Reilly
>  wrote:
[snip]
> > So: does anyone know how to modify the boot-time order so that
> > svscan starts at (or before) the point in the boot cycle where
> > BIND would, on other systems?  I suspect that it should be
> > possible by changing the PROVIDE: in svscan.sh to include one of
> > the things REQUIRE:'d by ntpd.  Or perhaps the REQUIRE: LOGIN in
> > svscan.sh is incompatible with the BEFORE: LOGIN in ntpd?
> >
> > Has any other user of dnscache encountered and solved this
> > problem?
> >
> 
> I use the following in svscan.sh, no problems with ntpdate or any other 
> service:
> 
> # PROVIDE: svscan
> # REQUIRE: FILESYSTEMS netif pf
> # BEFORE:  routing

Thanks a lot for that!  I'll test it on one of my own machines[1] and
I'll incorporate it into the port's options in a couple of days.

G'luck,
Peter

[1] Yes, Andrew, I have the same problem on one machine which is only
restarted very rarely, so I just drop a curse and restart ntpd and
I couldn't be bothered to actually automate it... sorry for that!

-- 
Peter Pentchev  r...@ringlet.netr...@space.bgr...@freebsd.org
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
The rest of this sentence is written in Thailand, on


pgpEivyOr2aKU.pgp
Description: PGP signature


Re: How to get djbdns to start early enough to satisfy ntpd at boot?

2009-01-15 Thread Maxim Khitrov
On Thu, Jan 15, 2009 at 12:14 AM, Andrew Reilly
 wrote:
> Hi there,
>
> I've been a happy djbdns+tinydns user for many, many years.  I
> want to keep using it, so answers of the form "bletch!  Use ISC
> BIND the way BSD intended" will be ignored :-)
>
> Having said that, one annoying consequence of my transition
> some time ago to using ntpd, rather than just setting the clock
> once-off with ntpdate as I used to, is that the /etc/rc.d
> mechanism starts ntpd before /usr/local/etc/rc.d/svscan.sh
> starts svscan, which starts /services/dnscache.  That wouldn't
> matter if ntpd was a bit sensible and just kept trying to find
> its nomminated servers, but it gives up and just sits there not
> synchronising time from any reference.  So I have to remember to
> manually "/etc/rc.d/ntpd restart" every time I reboot.
>
> So: does anyone know how to modify the boot-time order so that
> svscan starts at (or before) the point in the boot cycle where
> BIND would, on other systems?  I suspect that it should be
> possible by changing the PROVIDE: in svscan.sh to include one of
> the things REQUIRE:'d by ntpd.  Or perhaps the REQUIRE: LOGIN in
> svscan.sh is incompatible with the BEFORE: LOGIN in ntpd?
>
> Has any other user of dnscache encountered and solved this
> problem?
>

I use the following in svscan.sh, no problems with ntpdate or any other service:

# PROVIDE: svscan
# REQUIRE: FILESYSTEMS netif pf
# BEFORE:  routing

- Max
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: How to get djbdns to start early enough to satisfy ntpd at boot?

2009-01-15 Thread Ben Morrow
Quoth Andrew Reilly :
> 
> So: does anyone know how to modify the boot-time order so that
> svscan starts at (or before) the point in the boot cycle where
> BIND would, on other systems?  I suspect that it should be
> possible by changing the PROVIDE: in svscan.sh to include one of
> the things REQUIRE:'d by ntpd.  Or perhaps the REQUIRE: LOGIN in
> svscan.sh is incompatible with the BEFORE: LOGIN in ntpd?
> 
> Has any other user of dnscache encountered and solved this
> problem?

I have, in my svscan.sh,

# PROVIDE: svscan
# REQUIRE: SERVERS cleanvar

and I also have a /usr/local/etc/rc.d/dnscache which looks like

#!/bin/sh

# PROVIDE: named
# REQUIRE: svscan

. /etc/rc.subr
. /usr/local/etc/svc.subr

name="dnscache"
rcvar=`set_rcvar`

: ${dnscache_enable:="NO"}

load_rc_config $name
load_svc_subr_config

run_rc_command "$1"

and a /usr/local/etc/svc.subr as attached. It's somewhat more general
than is needed for dnscache, as I also use it to start qmail.

Basically: the PROVIDE: named line is needed to get dnscache up before
ntpd, and the REQUIRE: LOGIN line needs to be changed.

Ben

#
# Subroutines for handling services under the control of svscan(8).
# Requires rc.subr is loaded first.
#

load_svc_subr_config () {
load_rc_config_var svscan svscan_servicedir

: ${svscan_servicedir:=/var/service}
: ${svc:=/usr/local/bin/svc}
: ${svok:=/usr/local/bin/svok}
: ${svstat:=/usr/local/bin/svstat}

: ${svcname:=${name}}   
: ${service_dir:=${svscan_servicedir}/${svcname}}
: ${svok_timeout:=30}
: ${svstat_timeout:=30}

: ${start_cmd:=svc_subr_start}
: ${stop_cmd:=svc_subr_stop}
: ${restart_cmd:=svc_subr_restart}

: ${extra_commands:="status reload flush"}
: ${status_cmd:=svc_subr_status}
: ${reload_cmd:=svc_subr_reload}
: ${flush_cmd:=svc_subr_flush}
}

svc_subr_isup () {
$svstat $1 | grep -q ": up"
}

svc_subr_isdown () {
$svstat $1 | grep -q ": down"
}

svc_subr_waitfor () {
local n check timeout err

check="$1"
timeout=$2
err="$3"

n=0
while [ $n -lt $timeout ] && ! $check $service_dir
do
sleep 1
n=$(( n + 1 ))
done

if ! $check $service_dir
then
echo "$err" >&2
exit 1
fi
}

svc_subr_start () {

echo -n "Checking ${name} is up"

svc_subr_waitfor $svok $svok_timeout \
"supervise is not running in ${service_dir}!"

$svc -u $service_dir

svc_subr_waitfor svc_subr_isup $svstat_timeout \
"${service_dir} won't come up!"

echo "."
}

svc_subr_stop () {

echo -n "Bringing ${name} down"

$svc -d $service_dir

svc_subr_waitfor svc_subr_isdown $svstat_timeout \
"${service_dir} won't come down, trying SIGKILL"

svc -k $service_dir

svc_subr_waitfor svc_subr_isdown $svstat_timeout \
"${service_dir} won't come down!"

echo "."
}

svc_subr_restart () {
echo -n "Sending ${name} a SIGTERM"
$svc -t $service_dir
echo "."
}

svc_subr_reload () {
echo -n "Sending ${name} a SIGHUP"
$svc -h $service_dir
echo "."
}

svc_subr_flush () {
echo -n "Sending ${name} a SIGALRM"
$svc -a $service_dir
echo "."
}

svc_subr_status () {
$svstat $service_dir
}
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Re: How to get djbdns to start early enough to satisfy ntpd at boot?

2009-01-15 Thread Oliver Fromme
Andrew Reilly wrote:
 > So: does anyone know how to modify the boot-time order so that
 > svscan starts at (or before) the point in the boot cycle where
 > BIND would, on other systems?  I suspect that it should be
 > possible by changing the PROVIDE: in svscan.sh to include one of
 > the things REQUIRE:'d by ntpd.  Or perhaps the REQUIRE: LOGIN in
 > svscan.sh is incompatible with the BEFORE: LOGIN in ntpd?

I think "BEFORE: ntpd" should be sufficient.

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"Unix gives you just enough rope to hang yourself --
and then a couple of more feet, just to be sure."
-- Eric Allman
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"