Re: Stepping the clock during boot

2010-08-03 Thread Petter Reinholdtsen
[John Hasler]
 Would it be unacceptable for Chrony to step the clock (particularly
 back) during boot?

If you are going to do this, it might be a good idea to try to do it
before the syslog collector starts, as most daemons depend on $syslog
and would thus start after the clock is correct.

Happy hacking,
-- 
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2flaap45dpx@login2.uio.no



Re: Stepping the clock during boot

2010-08-03 Thread Edward Allcutt

On Tue, 3 Aug 2010, John Hasler wrote:

I wrote:

Well, it's a reason.  But note that such backward stepping would only
happen when your clock is really screwed up.


brian writes:

It actually used to happen every reboot of my server, which is why I'm
aware of the dovecot problem.  When ntp (or ntpdate, I'm not sure
which) would correct the time, the clock would move backwards 30
seconds or so and dovecot would crash.


I can add an X-Starts-Before: dovecot line to protect dovecot.

I think that ideally chrony would replace hwclock as provider of $time
when present but I don't know how to arrange that...


You could append +chrony to the $time line in /etc/insserv.conf as a local
fix. You might be able to ship a /etc/insserv.conf.d/chrony that to that
effect but I'm unsure whether that would replace or add to the existing
line. I couldn't find documentation on exactly how the /etc/insserv.conf.d
files work.

--
Edward Allcutt


--
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/alpine.deb.2.00.1008031008260.2...@jago.allcutt.me.uk



Re: Stepping the clock during boot

2010-08-03 Thread Petter Reinholdtsen

[Edward Allcutt]
 You could append +chrony to the $time line in /etc/insserv.conf as a local
 fix. You might be able to ship a /etc/insserv.conf.d/chrony that to that
 effect but I'm unsure whether that would replace or add to the existing
 line. I couldn't find documentation on exactly how the /etc/insserv.conf.d
 files work.

It will add it to the existing line.

Happy hacking,
-- 
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2flpqy03upz@login2.uio.no



Re: Stepping the clock during boot

2010-08-03 Thread John Hasler
Jaldhar H. Vyas writes:
 I haven't really looked into the new dependency-based stuff so this
 might be a naive question but wouldn't X-Starts-After: chrony in
 dovecots init script be a better idea?

There is no such thing as far as I know (and I should have written
X-Start-Before: no s).  A Should-Start might suffice, though.

-- 
John Hasler


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87y6cnao4i@thumper.dhh.gt.org



Re: Stepping the clock during boot

2010-08-03 Thread John Hasler
Edward Allcutt writes:
 You could append +chrony to the $time line in /etc/insserv.conf as a
 local fix. You might be able to ship a /etc/insserv.conf.d/chrony that
 to that effect but I'm unsure whether that would replace or add to the
 existing line.

As Peter says, it would add it to the existing line.  That wouldn't
really help as hwclock is always present and would satisfy the $time
requirements before chrony started.

-- 
John Hasler


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87tynbamn7@thumper.dhh.gt.org



Re: Stepping the clock during boot

2010-08-03 Thread John Hasler
Petter Reinholdtsen writes:
 If you are going to do this, it might be a good idea to try to do it
 before the syslog collector starts, as most daemons depend on $syslog
 and would thus start after the clock is correct.

Unfortunately, chrony also wants $syslog.
-- 
John Hasler


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87pqxzamgf@thumper.dhh.gt.org



Re: Stepping the clock during boot

2010-08-03 Thread Petter Reinholdtsen

[John Hasler]
 As Peter says, it would add it to the existing line.  That wouldn't
 really help as hwclock is always present and would satisfy the $time
 requirements before chrony started.

Actually, it would help, because all the parts making up $time need to
be satisfied before those depending on $time will start.

PS: Peter Reinholdtsen is my cousin. :)

Happy hacking,
-- 
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2fl7hk7g5ae@login1.uio.no



Re: Stepping the clock during boot

2010-08-03 Thread John Hasler
Petter Reinholdtsen writes:
 Actually, [a chrony file in insserv.conf.d] would help, because all
 the parts making up $time need to be satisfied before those depending
 on $time will start.

Then that solves my problem (should apply to ntp too) if adding a file to
insserv.conf.d containing

$time  chrony

guarantees that no script depending on $time will start before chrony
does.

No, wait.  Chrony depends on things that depend indirectly on $time (so
does ntp, IIRC).
-- 
John Hasler


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87y6cn9070@thumper.dhh.gt.org



Re: Stepping the clock during boot

2010-08-03 Thread Petter Reinholdtsen
[John Hasler]
 No, wait.  Chrony depends on things that depend indirectly on $time
 (so does ntp, IIRC).

Yes, such change need to be done very carefully and in stages, to
avoid dependency loops.  See #542602 for a discussion on the ntp order
relative to $syslog. :)

Happy hacking,
-- 
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/2fl1vaffvth@login1.uio.no



Re: Stepping the clock during boot

2010-08-03 Thread John Hasler
Petter Reinholdtsen writes:
 Yes, such change need to be done very carefully and in stages, to
 avoid dependency loops.  See #542602 for a discussion on the ntp order
 relative to $syslog.

After some research I'm tending to think that many (if not most) of the
scripts that require $time, shouldn't (or at least should only require
hwclockfirst).  I also don't see that we still need two hwclock scripts.
Then ntp, chrony, and hwclock could provide $time and only those
packages that really need exact time should require it.  If the clock
gets stepped at bootup that fact will be quite obvious in the logs so
$syslog should be able live with the rare stepping.

I think I'll have chrony require hwclockfirst and add X-Start-Befores
for packages such as dovecot that stepping might break (so if you know
of such a package tell me).

-- 
John Hasler


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87lj8n8pp5@thumper.dhh.gt.org



Re: Stepping the clock during boot

2010-08-03 Thread John Hasler
I wrote:
 After some research I'm tending to think that many (if not most) of
 the scripts that require $time, shouldn't (or at least should only
 require hwclockfirst).  I also don't see that we still need two
 hwclock scripts.

BTW hwclockfirst.sh and hwclock.sh add about a 1.5 second delay.
-- 
John Hasler


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87d3tz8dm6@thumper.dhh.gt.org



Re: Stepping the clock during boot

2010-08-02 Thread brian m. carlson
On Mon, Aug 02, 2010 at 04:24:52PM -0500, John Hasler wrote:
 Would it be unacceptable for Chrony to step the clock (particularly
 back) during boot?  This would only happen when the clock was at least
 30 seconds off but I'm concerned that it might screw some of the daemons
 that might already have started.  If Chrony can't step the clock it
 would have to slew it (which can take hours for large errors) or give
 up.  This would only happen on rare occasions.

dovecot kills itself when time moves backwards too much.  See
http://wiki.dovecot.org/TimeMovedBackwards.  I don't think it would be
okay unless you can either make sure that dovecot handles this
gracefully (and that involves not needing to be restarted or
disconnecting users) or change the time only before normal
(non-time-related) services start.  I think the latter is prudent
anyway.

Other than this, I don't know any reason why you shouldn't.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187


signature.asc
Description: Digital signature


Re: Stepping the clock during boot

2010-08-02 Thread Adam Borowski
On Mon, Aug 02, 2010 at 04:24:52PM -0500, John Hasler wrote:
 Would it be unacceptable for Chrony to step the clock (particularly
 back) during boot?  This would only happen when the clock was at least
 30 seconds off but I'm concerned that it might screw some of the daemons
 that might already have started.  If Chrony can't step the clock it
 would have to slew it (which can take hours for large errors) or give
 up.  This would only happen on rare occasions.

I think it's better to risk tripping buggy daemons rather than accept the
clock being set to 2007.  And most of those which are likely to be run early
during bootup have already been fixed.

The most likely source of problems is ext3 in its default settings -- but
hey, those default settings the last time I looked still included gems like
let's randomly DoS the machine for 15 mins during boot just in case or
let's throw out 50GB of space because having 1MB reserved had been
beneficial in the 1970s on massively multiuser systems.

I think it's be worthy to try stepping to see if something breaks down
badly, so we can fix it.

Meow!
-- 
1KB // Microsoft corollary to Hanlon's razor:
//  Never attribute to stupidity what can be
//  adequately explained by malice.


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20100802230856.ga30...@angband.pl



Re: Stepping the clock during boot

2010-08-02 Thread John Hasler
brian m. carlson writes:
 I don't think it would be okay unless you can either make sure that
 dovecot handles this gracefully (and that involves not needing to be
 restarted or disconnecting users)...

I don't see how I can do that.

 ...or change the time only before normal (non-time-related) services
 start.  I think the latter is prudent anyway.

Of course, but that is very hard to ascertain with dependency-based
booting.  Chrony requires $remote_fs so it's starting fairly late.  I
suppose I could put in a bunch of X-Start-Before lines, but I'd have
to know what all could be adversely affected and booting would be
slowed.

 Other than this, I don't know any reason why you shouldn't.

Well, it's a reason.  But note that such backward stepping would only
happen when your clock is really screwed up.
-- 
John Hasler


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87iq3sbnla@thumper.dhh.gt.org



Re: Stepping the clock during boot

2010-08-02 Thread brian m. carlson
On Mon, Aug 02, 2010 at 06:29:21PM -0500, John Hasler wrote:
 Well, it's a reason.  But note that such backward stepping would only
 happen when your clock is really screwed up.

It actually used to happen every reboot of my server, which is why I'm
aware of the dovecot problem.  When ntp (or ntpdate, I'm not sure which)
would correct the time, the clock would move backwards 30 seconds or so
and dovecot would crash.

I've since replaced the hardware with something newer and this problem
does not occur anymore.  Just be aware that some motherboards for Core 2
Duos do have this problem and that you may very well run into it.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187


signature.asc
Description: Digital signature


Re: Stepping the clock during boot

2010-08-02 Thread John Hasler
I wrote:
 Well, it's a reason.  But note that such backward stepping would only
 happen when your clock is really screwed up.

brian writes:
 It actually used to happen every reboot of my server, which is why I'm
 aware of the dovecot problem.  When ntp (or ntpdate, I'm not sure
 which) would correct the time, the clock would move backwards 30
 seconds or so and dovecot would crash.

I can add an X-Starts-Before: dovecot line to protect dovecot.

I think that ideally chrony would replace hwclock as provider of $time
when present but I don't know how to arrange that...
-- 
John Hasler


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/8739uwbeup@thumper.dhh.gt.org



Re: Stepping the clock during boot

2010-08-02 Thread Jaldhar H . Vyas
John Hasler jhasler at debian.org writes:

 
 I wrote:
  Well, it's a reason.  But note that such backward stepping would only
  happen when your clock is really screwed up.
 
 brian writes:
  It actually used to happen every reboot of my server, which is why I'm
  aware of the dovecot problem.  When ntp (or ntpdate, I'm not sure
  which) would correct the time, the clock would move backwards 30
  seconds or so and dovecot would crash.
 
 I can add an X-Starts-Before: dovecot line to protect dovecot.
 

I haven't really looked into the new dependency-based stuff so this might be a
naive question but wouldn't X-Starts-After: chrony in dovecots init script be
a better idea?

-- 
Jaldhar H. Vyas jald...@debian.org


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/loom.20100803t051259-...@post.gmane.org