1 1
Romber

Date synchronization

Recommended Posts

I run this command I saw that my system clock is not synchronized.
destructor@orangepiplus:~$ timedatectl 
               Local time: Mon 2020-05-18 14:05:45 EEST
           Universal time: Mon 2020-05-18 11:05:45 UTC
                 RTC time: Tue 1970-01-06 15:48:55
                Time zone: Europe/Kiev (EEST, +0300)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no

So how can I active ntp server?

I undestand that is common Linux OS question but when I installed Linux OS on PC devices it never disturb me because there it worked as default

Share this post


Link to post
Share on other sites
16 hours ago, Romber said:

I run this command I saw that my system clock is not synchronized.
destructor@orangepiplus:~$ timedatectl 
               Local time: Mon 2020-05-18 14:05:45 EEST
           Universal time: Mon 2020-05-18 11:05:45 UTC
                 RTC time: Tue 1970-01-06 15:48:55
                Time zone: Europe/Kiev (EEST, +0300)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no

So how can I active ntp server?

I undestand that is common Linux OS question but when I installed Linux OS on PC devices it never disturb me because there it worked as default

You'll need to check your chrony config (https://chrony.tuxfamily.org/index.html) which is enabled by default.

Share this post


Link to post
Share on other sites
12 hours ago, Werner said:

armbianmonitor -u

destructor@orangepiplus:~$ armbianmonitor -u

Network/firewall problem detected. Not able to upload debug info.
Please fix this or use "-U" instead and upload whole output manually
 

Share this post


Link to post
Share on other sites
22 hours ago, Romber said:

I run this command I saw that my system clock is not synchronized.
destructor@orangepiplus:~$ timedatectl 

 

So how can I active ntp server?

I undestand that is common Linux OS question but when I installed Linux OS on PC devices it never disturb me because there it worked as default

timedatectl belongs to the timesyncd - which is normally used on the ubuntu-desktop.

 

If you use armbian then normally ntpd or chronyd is used.

 

To enable ntp for timesyncd
( see also https://askubuntu.com/questions/1058593/how-to-sync-the-time-to-network-with-timedatectl-on-ubuntu-18-04 )
use
sudo timedatectl set-ntp true
or
timedatectl set-ntp 1

 

then check id it does work via

systemctl status systemd-timesyncd.service

 

check also if the ntp-servers in /etc/systemd/timesyncd.conf are reachable

(german: https://www.dinotools.de/2015/01/12/zeit-per-systemd-mit-timesyncd-synchronisieren/ )

 

or use chronyd ;)

Share this post


Link to post
Share on other sites
3 minutes ago, Romber said:

destructor@orangepiplus:~$ armbianmonitor -u

Network/firewall problem detected. Not able to upload debug info.
Please fix this or use "-U" instead and upload whole output manually
 

Ahhh :) if you cant upload the log maybe you also cant reach the ntp server - so no sychonisation! :) 

 

Share this post


Link to post
Share on other sites

For a test I deinstalled chrony on my armbian and armbian did automatically install/activate me timesyncd as replacement:
 

Spoiler

root@npi-neo2-24(192.168.6.24):~# apt remove chrony
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  systemd-timesyncd
The following packages will be REMOVED:
  chrony
The following NEW packages will be installed:
  systemd-timesyncd
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 123 kB of archives.
After this operation, 314 kB disk space will be freed.
Do you want to continue? [Y/n]
Get:1 http://httpredir.debian.org/debian bullseye/main arm64 systemd-timesyncd arm64 245.5-3 [123 kB]
Fetched 123 kB in 1s (244 kB/s)
dpkg: chrony: dependency problems, but removing anyway as you requested:
 systemd depends on systemd-timesyncd | time-daemon; however:
  Package systemd-timesyncd is not installed.
  Package time-daemon is not installed.
  Package chrony which provides time-daemon is to be removed.

(Reading database ... 37771 files and directories currently installed.)
Removing chrony (3.5-8) ...
Selecting previously unselected package systemd-timesyncd.
(Reading database ... 37741 files and directories currently installed.)
Preparing to unpack .../systemd-timesyncd_245.5-3_arm64.deb ...
Unpacking systemd-timesyncd (245.5-3) ...
Setting up systemd-timesyncd (245.5-3) ...
Created symlink /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service → /lib/systemd/system/systemd-timesyncd.service.
Processing triggers for dbus (1.12.16-2) ...
Processing triggers for man-db (2.9.1-1) ...
 

 

and timedatectl is working fine :)

root@npi-neo2-24(192.168.6.24):~# timedatectl
               Local time: Wed 2020-05-20 22:29:21 +03
           Universal time: Wed 2020-05-20 19:29:21 UTC
                 RTC time: Wed 2020-05-20 19:29:23
                Time zone: Asia/Istanbul (+03, +0300)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

 

Share this post


Link to post
Share on other sites
1 hour ago, guidol said:

For a test I deinstalled chrony on my armbian and armbian did automatically install/activate me timesyncd as replacement:
 

  Reveal hidden contents

root@npi-neo2-24(192.168.6.24):~# apt remove chrony
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  systemd-timesyncd
The following packages will be REMOVED:
  chrony
The following NEW packages will be installed:
  systemd-timesyncd
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 123 kB of archives.
After this operation, 314 kB disk space will be freed.
Do you want to continue? [Y/n]
Get:1 http://httpredir.debian.org/debian bullseye/main arm64 systemd-timesyncd arm64 245.5-3 [123 kB]
Fetched 123 kB in 1s (244 kB/s)
dpkg: chrony: dependency problems, but removing anyway as you requested:
 systemd depends on systemd-timesyncd | time-daemon; however:
  Package systemd-timesyncd is not installed.
  Package time-daemon is not installed.
  Package chrony which provides time-daemon is to be removed.

(Reading database ... 37771 files and directories currently installed.)
Removing chrony (3.5-8) ...
Selecting previously unselected package systemd-timesyncd.
(Reading database ... 37741 files and directories currently installed.)
Preparing to unpack .../systemd-timesyncd_245.5-3_arm64.deb ...
Unpacking systemd-timesyncd (245.5-3) ...
Setting up systemd-timesyncd (245.5-3) ...
Created symlink /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service → /lib/systemd/system/systemd-timesyncd.service.
Processing triggers for dbus (1.12.16-2) ...
Processing triggers for man-db (2.9.1-1) ...
 

 

and timedatectl is working fine :)


root@npi-neo2-24(192.168.6.24):~# timedatectl
               Local time: Wed 2020-05-20 22:29:21 +03
           Universal time: Wed 2020-05-20 19:29:21 UTC
                 RTC time: Wed 2020-05-20 19:29:23
                Time zone: Asia/Istanbul (+03, +0300)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

But not in my server

 

Share this post


Link to post
Share on other sites
8 hours ago, Romber said:

But not in my server

firstly you need to get your network running (incl. internet-access) to complete

- armbianmonitor -u
- systemctl status systemd-timesyncd.service
and
- timedatectl

 

to check if you can connect to the internet/ntp-servers and what kind of armbian you run

Without that information is mostly impossible to help :( 

Share this post


Link to post
Share on other sites
14 hours ago, guidol said:

to check if you can connect to the internet/ntp-servers and what kind of armbian you run

         _,met$$$$$gg.           @orangepiplus
      ,g$$$$$$$$$$$$$$$P.        OS: Debian 10 buster
    ,g$$P""       """Y$$.".      Kernel: armv7l Linux 5.4.35-sunxi
   ,$$P'              `$$$.      Uptime: 2d 28m
  ',$$P       ,ggs.     `$$b:    Packages: 961
  `d$$'     ,$P"'   .    $$$     Shell: 21642
   $$P      d$'     ,    $$P     CPU: ARMv7 rev 5 (v7l) @ 4x 1.368GHz
   $$:      $$.   -    ,d$$'     GPU: 
   $$\;      Y$b._   _,d$P'      RAM: 172MiB / 2012MiB
   Y$$.    `.`"Y$$$$P"'         
   `$$b      "-.__              
    `Y$$                        
     `Y$$.                      
       `$$b.                    
         `Y$$b.                 
            `"Y$b._             
                `""""           

@orangepiplus:~$ armbianmonitor -u

Network/firewall problem detected. Not able to upload debug info.
Please fix this or use "-U" instead and upload whole output manually

 

@orangepiplus:~$ systemctl status systemd-timesyncd.service
● systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/systemd-timesyncd.service.d
           └─disable-with-time-daemon.conf
   Active: inactive (dead)
Condition: start condition failed at Tue 2020-05-19 12:33:35 EEST; 24h ago
     Docs: man:systemd-timesyncd.service(8)

May 18 12:56:57 orangepiplus systemd[1]: Condition check resulted in Network Time Synchronization being skipped.
May 19 12:33:01 orangepiplus systemd[1]: Condition check resulted in Network Time Synchronization being skipped.
May 19 12:33:35 orangepiplus systemd[1]: Condition check resulted in Network Time Synchronization being skipped.


@orangepiplus:~$ timedatectl 
               Local time: Wed 2020-05-20 13:26:14 EEST
           Universal time: Wed 2020-05-20 10:26:14 UTC
                 RTC time: Thu 1970-01-08 15:09:11
                Time zone: Europe/Kiev (EEST, +0300)
System clock synchronized: no
              NTP service: inactive
          RTC in local TZ: no
 

Share this post


Link to post
Share on other sites

What @guidol is saying is that without internet connectivity you won't be able to NTP sync your clock (as NTP = network time protocol). The fact that 'armbianmonitor -u' is unable to upload you debug info indicates there's a problem with your network.

 

Please use 'armbianmonitor -U' (notice capital U, see also note given in your output) and upload the results manually or post them here (try using a codebox).

If this does not work for you atleast try something like 'ping google.com' to make sure your board can even connect to the internet. Otherwise NTP will not work.

Share this post


Link to post
Share on other sites
1 hour ago, Romber said:

Network/firewall problem detected. Not able to upload debug info.
 

 

May 18 12:56:57 orangepiplus systemd[1]: Condition check resulted in Network Time Synchronization being skipped.

 

               Local time: Wed 2020-05-20 13:26:14 EEST
           Universal time: Wed 2020-05-20 10:26:14 UTC
                 RTC time: Thu 1970-01-08 15:09:11
System clock synchronized: no
              NTP service: inactive

 

All these messages show us, that you network isnt working or isnt working correct.

 

How did you configure your network? Network-Manager? /etc/network/interfaces? armbian-config?

 

Can you ping 8.8.8.8?

Can you ping armbian.com?

What says ifconfig for eth0 or wlan0?

whats the IP of your gateway/DNS?

what is the content of /etc/resolv.conf (when not using network-manager)

 

Share this post


Link to post
Share on other sites

motd seems weird. did you start with a debian image (i.e. not coming from www.armbian.com/download) and pulled armbian repositories afterwards?

 

Share this post


Link to post
Share on other sites
On 5/22/2020 at 12:40 AM, Heisath said:

What @guidol is saying is that without internet connectivity you won't be able to NTP sync your clock (as NTP = network time protocol). The fact that 'armbianmonitor -u' is unable to upload you debug info indicates there's a problem with your network.

 

Please use 'armbianmonitor -U' (notice capital U, see also note given in your output) and upload the results manually or post them here (try using a codebox).

If this does not work for you atleast try something like 'ping google.com' to make sure your board can even connect to the internet. Otherwise NTP will not

Network is connected. ping Google.com is executing good.  armbianmonitor -U shows very much text.   

Share this post


Link to post
Share on other sites
On 5/22/2020 at 1:10 AM, guidol said:

 

All these messages show us, that you network isnt working or isnt working correct.

 

How did you configure your network? Network-Manager? /etc/network/interfaces? armbian-config?

 

Can you ping 8.8.8.8?

Can you ping armbian.com?

What says ifconfig for eth0 or wlan0?

whats the IP of your gateway/DNS?

what is the content of /etc/resolv.conf (when not using network-manager)

 

destructor@orangepiplus:~$ cat /etc/network/interfaces

source /etc/network/interfaces.d/*

# Network is managed by Network manager

auto lo iface lo inet loopback

 

All ping work

 

:28:19 2020 from destructor@orangepiplus:~$ sudo ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500         inet 192.168.0.104  netmask 255.255.255.0  broadcast 192.168.0.255         inet6 fe80::8e0:7c3e:c125:9a2a  prefixlen 64  scopeid 0x20<link>         ether 02:81:7d:85:f6:f7  txqueuelen 1000  (Ethernet)         RX packets 117227  bytes 98206563 (93.6 MiB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 68716  bytes 8157760 (7.7 MiB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0         device interrupt 32  lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536         inet 127.0.0.1  netmask 255.0.0.0         inet6 ::1  prefixlen 128  scopeid 0x10<host>  loop  txqueuelen 1000  (Local Loopback)         RX packets 302  bytes 15100 (14.7 KiB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 302  bytes 15100 (14.7 KiB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500         ether e0:b9:4d:1e:8e:3f  txqueuelen 1000  (Ethernet)         RX packets 0  bytes 0 (0.0 B) RX errors 0  dropped 0  overruns 0  frame 0         TX packets 0  bytes 0 (0.0 B) TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

 

 

destructor@orangepiplus:~$ cat /etc/resolv.conf

# Generated by NetworkManagernameserver 8.8.8.8 nameserver 192.168.0.1

Share this post


Link to post
Share on other sites
16 hours ago, Romber said:

Network is connected. ping Google.com is executing good.  armbianmonitor -U shows very much text.   

 

# sudo ufw reset

# armbianmonitor -u

 

# ntpdate -vd <ntpserver>

 

 

 

Share this post


Link to post
Share on other sites
5 hours ago, xwiggen said:

 

# sudo ufw reset

# armbianmonitor -u

 

# ntpdate -vd <ntpserver>

 

 

 

sudo: ufw: command not found

Ok, I've installed it.

@orangepiplus:~$ sudo ufw reset
Resetting all rules to installed defaults. This may disrupt existing ssh
connections. Proceed with operation (y|n)? y
Backing up 'user.rules' to '/etc/ufw/user.rules.20200522_144043'
Backing up 'before.rules' to '/etc/ufw/before.rules.20200522_144043'
Backing up 'after.rules' to '/etc/ufw/after.rules.20200522_144043'
Backing up 'user6.rules' to '/etc/ufw/user6.rules.20200522_144043'
Backing up 'before6.rules' to '/etc/ufw/before6.rules.20200522_144043'
Backing up 'after6.rules' to '/etc/ufw/after6.rules.20200522_144043'
 

@orangepiplus:~$ armbianmonitor -u

Network/firewall problem detected. Not able to upload debug info.
Please fix this or use "-U" instead and upload whole output manually
 

What is next? I think that I more and more break my system

Share this post


Link to post
Share on other sites
13 hours ago, Romber said:

What is next? I think that I more and more break my system

I'm pretty sure you started with a debian img and migrated to armbian:

# fping armbian.com

yields command not find, right?

 

Anyhow, looks like fake hwclock failed to retain at least the datetime after last package install/reboot/shutdown.

That's bad cause pretty much anything in userspace assumes datetime only moves forward.

 

Start with a clean armbian image for your board (https://www.armbian.com/download) and come back if ntp is still not working.

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
1 minute ago, xwiggen said:

I'm pretty sure you started with a debian img and migrated to armbian:

# fping armbian.com

yields command not find, right?

 

Anyhow, looks like fake hwclock failed to retain at least the datetime after last package install/reboot/shutdown, maybe because /var is optimized in armbian (ram sync) and possibly not in debian resulting in an empty hwclock file.

 

That's bad cause pretty much anything in userspace assumes datetime only moves forward.

 

Start with a clean armbian image for your board (https://www.armbian.com/download) and come back if ntp is still not working.

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
On 5/23/2020 at 1:22 AM, xwiggen said:

motd seems weird. did you start with a debian image 

this seems to be an optional systeminfo-"tool" named neofetch:
https://github.com/dylanaraps/neofetch

 

Quote

Neofetch is a command-line system information tool written in bash 3.2+. Neofetch displays information about your operating system, software and hardware in an aesthetic and visually pleasing way.

 

Installation:

https://github.com/dylanaraps/neofetch/wiki/Installation

 

2 examples: 
 

root@npi-neo2-24(192.168.6.24):/home/guido/neofetch# neofetch
       _,met$$$$$gg.          root@npi-neo2-24
    ,g$$$$$$$$$$$$$$$P.       ----------------
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux bullseye/sid aarch64
 ,$$P'              `$$$.     Host: FriendlyARM NanoPi NEO 2
',$$P       ,ggs.     `$$b:   Kernel: 5.6.12-sunxi64
`d$$'     ,$P"'   .    $$$    Uptime: 4 days, 1 hour, 49 mins
 $$P      d$'     ,    $$P    Packages: 534 (dpkg)
 $$:      $$.   -    ,d$$'    Shell: bash 5.0.16
 $$;      Y$b._   _,d$P'      Terminal: /dev/pts/0
 Y$$.    `.`"Y$$$$P"'         CPU: sun50iw1p1 (4) @ 1.008GHz
 `$$b      "-.__              Memory: 124MiB / 987MiB
  `Y$$
   `Y$$.
     `$$b.
       `Y$$b.
          `"Y$b._
              `"""

root@fox-g20(192.168.6.15):/home/guido/neofetch# neofetch
       _,met$$$$$gg.          root@fox-g20
    ,g$$$$$$$$$$$$$$$P.       ------------
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 9 (stretch) armv5tejl
 ,$$P'              `$$$.     Host: Acme Systems FOX Board G20
',$$P       ,ggs.     `$$b:   Kernel: 4.9.124+
`d$$'     ,$P"'   .    $$$    Uptime: 1 day, 11 hours, 22 mins
 $$P      d$'     ,    $$P    Packages: 442 (dpkg)
 $$:      $$.   -    ,d$$'    Shell: bash 4.4.12
 $$;      Y$b._   _,d$P'      Terminal: /dev/pts/0
 Y$$.    `.`"Y$$$$P"'         CPU: Atmel AT91SAM9 (1)
 `$$b      "-.__              Memory: 10MiB / 56MiB
  `Y$$
   `Y$$.
     `$$b.
       `Y$$b.
          `"Y$b._
              `"""

see also:

https://www.omgubuntu.co.uk/2016/11/neofetch-terminal-system-info-app

 

Share this post


Link to post
Share on other sites
28 minutes ago, guidol said:

this seems to be an optional systeminfo-"tool" named neofetch:
https://github.com/dylanaraps/neofetch

 

 

Installation:

https://github.com/dylanaraps/neofetch/wiki/Installation

 

2 examples: 
 


root@npi-neo2-24(192.168.6.24):/home/guido/neofetch# neofetch
       _,met$$$$$gg.          root@npi-neo2-24
    ,g$$$$$$$$$$$$$$$P.       ----------------
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux bullseye/sid aarch64
 ,$$P'              `$$$.     Host: FriendlyARM NanoPi NEO 2
',$$P       ,ggs.     `$$b:   Kernel: 5.6.12-sunxi64
`d$$'     ,$P"'   .    $$$    Uptime: 4 days, 1 hour, 49 mins
 $$P      d$'     ,    $$P    Packages: 534 (dpkg)
 $$:      $$.   -    ,d$$'    Shell: bash 5.0.16
 $$;      Y$b._   _,d$P'      Terminal: /dev/pts/0
 Y$$.    `.`"Y$$$$P"'         CPU: sun50iw1p1 (4) @ 1.008GHz
 `$$b      "-.__              Memory: 124MiB / 987MiB
  `Y$$
   `Y$$.
     `$$b.
       `Y$$b.
          `"Y$b._
              `"""

root@fox-g20(192.168.6.15):/home/guido/neofetch# neofetch
       _,met$$$$$gg.          root@fox-g20
    ,g$$$$$$$$$$$$$$$P.       ------------
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 9 (stretch) armv5tejl
 ,$$P'              `$$$.     Host: Acme Systems FOX Board G20
',$$P       ,ggs.     `$$b:   Kernel: 4.9.124+
`d$$'     ,$P"'   .    $$$    Uptime: 1 day, 11 hours, 22 mins
 $$P      d$'     ,    $$P    Packages: 442 (dpkg)
 $$:      $$.   -    ,d$$'    Shell: bash 4.4.12
 $$;      Y$b._   _,d$P'      Terminal: /dev/pts/0
 Y$$.    `.`"Y$$$$P"'         CPU: Atmel AT91SAM9 (1)
 `$$b      "-.__              Memory: 10MiB / 56MiB
  `Y$$
   `Y$$.
     `$$b.
       `Y$$b.
          `"Y$b._
              `"""

see also:

https://www.omgubuntu.co.uk/2016/11/neofetch-terminal-system-info-app

 

Ah thx, didn't know about this packagw.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
1 1