You are not logged in.

#1 2017-02-19 16:01:45

linka
Member
Registered: 2016-10-14
Posts: 7

System date changes when network connection is lost.

I have an issue concerning system time and date. My network connection is very unstable and it sometimes disappears multiple times a day. (I'm unable to fix it, I'm using a horrible router from my ISP that runs some even more horrible proprietary software) Each time it happens, the date is set to January 1 2003. It may have something to do with the RTC in the old netbook I'm using – it's probably broken in some way. How can I circumvent it?
Disabling ntpd doesn't help for some reason and turning it on doesn't help much either. It's even faster when I stop it, synchronise the time myself using ntpdate and start the daemon again. I have no experience with configuring the NTP client and I don't even know how to configure it so it works the way I want because I don't know where the problem is.

Offline

#2 2017-02-19 17:17:04

rstoyanov
Member
Registered: 2016-01-01
Posts: 7

Re: System date changes when network connection is lost.

Hi, @linka, I am not sure where the problem could be, but have you seen the arch-wiki page for NTPD ?

If I understand correctly, your netbook is reseting the date/time when the network connection is dropped.
Are there any failures when you  run

sudo dmesg | grep fail

and

sudo journalctl  -xe

Last edited by rstoyanov (2017-02-19 17:17:34)

Offline

#3 2017-02-19 17:53:28

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,785

Re: System date changes when network connection is lost.

What are the output of timedatectl  ?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2017-02-19 18:00:13

linka
Member
Registered: 2016-10-14
Posts: 7

Re: System date changes when network connection is lost.

Thank you for your answers. My dmesg only says:

[    0.396289] ACPI Error: [CAPB] Namespace lookup failure, AE_ALREADY_EXISTS (20160831/dsfield-211)
[    0.396317] ACPI Error: Method parse/execution failed [\_SB.PCI0._OSC] (Node ffff88003d89a938), AE_ALREADY_EXISTS (20160831/psparse-543)
[    0.396357] acpi PNP0A08:00: _OSC failed (AE_ALREADY_EXISTS); disabling ASPM

And timedatectl (when the problem occurs):

      Local time: śro 2003-01-01 01:09:57 CET
  Universal time: śro 2003-01-01 00:09:57 UTC
        RTC time: nie 2017-02-19 17:58:01
       Time zone: Europe/Warsaw (CET, +0100)
 Network time on: no
NTP synchronized: no
 RTC in local TZ: no

Offline

#5 2017-02-19 18:03:10

rstoyanov
Member
Registered: 2016-01-01
Posts: 7

Re: System date changes when network connection is lost.

Offline

#6 2017-02-19 18:04:53

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,553

Re: System date changes when network connection is lost.

rstoyanov wrote:

Please don't, that has nothing to do with the issue here.

Offline

#7 2017-02-19 18:50:32

rstoyanov
Member
Registered: 2016-01-01
Posts: 7

Re: System date changes when network connection is lost.

Not a solution but might helpful, having executable script to sync the system clock

/usr/bin/sync-clock
#!/bin/bash
sudo systemctl stop  ntpd.service
sudo ntpdate -s time.nist.gov
sudo systemctl start ntpd.service

Offline

#8 2017-02-19 18:54:50

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,785

Re: System date changes when network connection is lost.

That timedatectl looks rational.  What are you using to control your Internet connection?  NetworkManager?
Also, your hardware real time clock seems to be okay.  As does your timezone.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#9 2017-02-19 19:04:43

linka
Member
Registered: 2016-10-14
Posts: 7

Re: System date changes when network connection is lost.

@rstoyanov
Thanks, I guess it isn't so bad of an idea to make a script for that big_smile. My hardware is probably broken anyway (the router for sure)…

@ewaller
I'm using connman to manage my internet connection. I forgot to look into the output of 'journalctl -xe', now I did and among seemingly unrelated things, I noticed this:

lut 19 19:56:41 netbuk connmand[247]: ntp: time slew +0.034591 s

Maybe connman does something with the NTP client?

EDIT

I'm sorry, I just read that connman actually has its own NTP implementation, however I can't figure out how to configure it or switch it off. It seems poorly documented. Maybe I should just change my network manager?

Last edited by linka (2017-02-19 19:19:48)

Offline

Board footer

Powered by FluxBB