[systemd-devel] OT: Re: what to depend on to avoid file mtime discontinuities?
zbyszek at in.waw.pl
Tue Mar 19 11:22:51 PDT 2013
On Tue, Mar 19, 2013 at 10:11:32AM -0800, Britton Kerin wrote:
> On Tue, Mar 19, 2013 at 8:21 AM, Cristian Rodríguez
> <crrodriguez at opensuse.org> wrote:
> > El 18/03/13 14:56, Britton Kerin escribió:
> >> My service needs reasonably continuous mtimes on files.
> > That is the source of the problem, anything needing continuous mtimes is
> > operating under a broken assumption.
> > - You have timezone changes and leap seconds.
> > - You have machines that either by design or by error have a broken or
> > absent hardware clock (the raspberry pi for example, has no rtc)
> > - NTP takes a while to settle down, even if you make your service to run
> > after ntp, it still might correct time minutes or sometimes hours later.
> > Im pretty sure that what your service is doing is totally wrong and you
> > might want to fill a bug report to whoever wrote it and point them to
> > inotify(7)
> Ok, well I wrote it so its an easy bug to report. I don't care how
> many seconds since 1970, what I want is access to some sort of clock
> that runs continually from some defined point on boot. It doesn't
> need to be particulary precise but must not have big discontinuities.
> Is there such a beast?
Sure: see clock_gettime(3) and CLOCK_MONOTONIC.
More information about the systemd-devel