1

I have a ODROID-C2 machine on which I am running Arch Linux. When I run journalctl -b, I can see that initially the time is wrong:

-- Logs begin at Thu 2020-02-13 20:01:10 GMT, end at Fri 2020-03-20 17:20:14 GMT. --
Feb 13 20:01:15 moby kernel: Initializing cgroup subsys cpuset
Feb 13 20:01:15 moby kernel: Initializing cgroup subsys cpu
Feb 13 20:01:15 moby kernel: Initializing cgroup subsys cpuacct
Feb 13 20:01:15 moby kernel: Linux version 3.16.81-1-ARCH (builduser@

Later, during the boot process, the time is updated:

Feb 13 20:01:26 moby dbus-daemon[246]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.0' (uid=981 pid=203 comm="/usr/lib/systemd/systemd-networkd ")
Feb 13 20:01:26 moby systemd[1]: Starting Hostname Service...
Mar 20 17:12:59 moby systemd-timesyncd[234]: Initial synchronization to time server 85.199.214.99:123 (0.arch.pool.ntp.org).
Mar 20 17:13:02 moby kernel: audit_printk_skb: 36 callbacks suppressed

1. Question: I would like the time to be (close to) correct right from the start. Is there any way of doing this with an ODROID-C2? It is my understanding that a battery is required for this to work and I don't think an ODROID-C2 has that. Update: Apparently, that is not something that can be done easily.

Most importantly, I want to make sure services are only started once the time is corrected as it can confuse timers etc. I read that the following can be done to potentially achieve that:

  1. Run: systemctl enable systemd-time-wait-sync.service
  2. Put: After=time-sync.target in the service file.

2. Question: Is that correct?

I am very confused because I don't think that this is what is happening. I have the following service file:

[Unit]
Description=Run check-updates.service every Friday at 8pm
After=time-sync.target

[Timer]
OnCalendar=Fri 20:00
Persistent=true

[Install]
WantedBy=timers.target

But I can read the following for journalctl -b:

Feb 13 20:01:25 moby systemd[262]: check-updates.timer: Not using persistent file timestamp Fri 2020-03-20 17:01:56 GMT as it is in the future.
Feb 13 20:01:25 moby systemd[262]: Started Run check-updates.service every Friday at 8pm.

which is clearly before the time has been updated to the correct time.

3. Question: How can I further debug this?

1 Answer 1

1

This may not be something that you can do w/o bios clock. I am not familiar with ODROID-C2 but have worked on some other embedded devices.

Since the system will start logging as soon as the kernel comes up journalctl output will have date stamps from whatever it gets from the system hardware clock until it can correct time. Since your device does not have a battery it cannot persist date. Your system will have bad times until the network comes up and gets time from NTP server.

There may be another way but I doubt it without BIOS supplying time at hardware init.

1
  • Thank you for the quick reply. That means that option 1 - setting the system clock is not possible. I'll try and see if I can hold back the other processes until the time is corrected.
    – gncs
    Commented Mar 20, 2020 at 20:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .