# ntp - YOU #$*%! ... Modification time in the future.

## Dirk.R.Gently

After I "emerge ntp" I rebooted and was told:

```
Some file in '/etc/{conf.d,init.d}' have Modification time in the future!
```

for about all my init scripts.  I also  found a lot of folders and stuff all over my system that were dated wrong -- really badly so.  Those affected files and directories were 3-months in the future!

It is possible that this has to do with a dead-battery.  Possibly the hardware clock is affected somehow without a battery present?  I read in two forums this may be the issue.  It appears that I have (at least) temporarilty fixed it.

k, fix the skewed time stamps over the whole system:

```
find /| xargs touch - m
```

have system clock set hardware clock at shutdown

```
nano /etc/conf.d/clock
```

	CLOCK_SYSTOHC="yes"

remove adjtime (sometimes it gets messed.)  Dont' worry it will be recreated.

```
rm /etc/adjtime
```

When you reboot the error will likely disappear.!?

FYI, the

cat /etc/adjtime

before:

-83718.182178 1173480376 0.000000

1173480376

LOCAL

after:

0.000000 1173484473 0.000000

1173484473

LOCAL

I would like to know a little more about this, if someone knows.  This is just a hack per say.  I'm not sure the reason why this works.

---

Edit: forgot to mention I tried to have the clock init script run after ntp.

----------

## krinn

 *Dirk.R.Gently wrote:*   

> It is possible that this has to do with a dead-battery.

 

without a battery bios reset its clock to its "zero" state, manufacturers set that state, old XT used 01/01/1970 (if i remember well), but todays motherboard should (have?) a more realistic 01/01/2000 but i don't really know, i'm getting too old to remove my battery to check it  :Razz: 

----------

## AllanS

This may also have to do with how your hardware clock is set relative to your time zone. In my case, the hardware clock is 0-UTC while all my timezone displays are set to eastern time zone (US). During some upgrades, the times of the files are updated. The startup script complains of future times. This continues until the local clock passes the UTC time associated with the files (for me, 5 hours later all is well).

----------

## Dirk.R.Gently

I've had clock skews that are related to timezone differences when UTC(or local) is set incorrectly.  I feel adjtime may be to blame.  If I understand correctly, adjtime finds natural skew of the clock and adjust the system clock periodically (without the use of ntp).  I think when I installed ntp it conflicted somehow with adjtime.

----------

## wynn

This post has some info on /etc/adjtime and how it is set.

----------

## Dirk.R.Gently

 *wynn wrote:*   

> This post has some info on /etc/adjtime and how it is set.

 

Well, it tells me that the /etc/init.d/clock has something to do with it.  I did try to make that init script load after ntp.  I wish I could just remove it.

----------

## wynn

/etc/adjtime is set whenever the hardware clock is set: typically this is on bootup and the code is in /etc/init.d/clock.

The problem is that if your BIOS time is way out for some reason then the clock drift in seconds/day in adjtime will be set to a large value. This value is used to 'correct' the hardware clock before using it to set the system time â thus system time is off by a large amount, file timestamps will be out and the "last mount time" and "last write time" on file systems will be out.

Not only that but if the hardware clock is corrected from within a booted Linux system, it will again set the drift to a large value and the cycle will continue.

The only way out is to delete /etc/adjtime (just setting the drift to 0.0 would do as well), make sure that "CLOCK_SYSTOHC" is set to "no" in /etc/conf.d/clock, reboot, set the hardware clock in the BIOS and boot again. You will still have all the way out timestamps and the mount and write times on filesystems but these should correct themselves after a boot or two.

----------

## roki942

Thanks Dirk & wynn .... I also had that problem when i booted today.  Some how the clock in bois got set as bing the 3rd but after following the steps here, everything is good.  :Smile: 

----------

