# [SOLVED] Raspberry Pi ntpdate and systemd

## AchilleTalon

I am having a Raspberry Pi installed with Gentoo/Linux 3.12.26 and systemd.

Although my setup includes timedatectl set-ntp true the time is not set properly after a reboot. I am getting my login banner before I get a message saying my eth0 interface is up and running. So, I guess the network time synchronization never occured when it was supposed to and even if ntpd is running the more than 44 years out synchronization prevents any synchronization to occurs at this point.

How am I supposed to setup systemd to make sure the network interface is up, then time is syncd and after that the boot procedure can continue?

Manually I have to do either:

```
# timedatectl set-ntp false

# ntpdate mysynchost

# timedatectl set-ntp true

```

or

```
# systemctl start ntpdate

# systemctl daemon-reload

```

This is beside the fact many files are created with a timestamp starting 1970-01-01 00:00:00 UTC.

This is annoying.

Any hints?

----------

## Etal

Have you tried enabling ntpdate.service?

----------

## AchilleTalon

Yes, it doesn't work neither. In fact, setting timedatectl set-ntp true is supposed to do that.

However, this time I am getting an error in the journal saying it cannot find the hosts, I guess this happens since the interface initialisation is not completed or has not even yet started when the command is issued. The name resolution is not yet active, I must conclude the dhcp protocol has not provided yet an address, gateway and DNS to the interface.

It is really something with the order things happen. I am getting the message the interface after the initialisation is completed and I have gotten the login banner. The interface should have been initialised way before that.

----------

## AchilleTalon

The problem resolved itself. Maybe some piece of software was still hanging around since the only thing I did is to do an emerge --depclean.

The only time the problem reappear, is when I overwrite my system image with my backup image and boot the first time. After setting the time and date, it holds, even if I shutdown and unplug the Raspberry Pi.

I really don't know what exactly solved the problem and cannot be useful to anyone that may encounter a similar problem in the future.

----------

