# dietpi-boot.service taking 40+ seconds on rpi3B and pinea64

**URL:** https://dietpi.com/forum/t/dietpi-boot-service-taking-40-seconds-on-rpi3b-and-pinea64/3772
**Category:** Troubleshooting
**Created:** [18 January 2020 21:40 UTC](https://dietpi.com/forum/t/dietpi-boot-service-taking-40-seconds-on-rpi3b-and-pinea64/3772 "2020-01-18T21:40:05Z")
**Posts on this page:** 5
**Page:** 2

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [24 January 2020 11:16 UTC](https://dietpi.com/forum/t/dietpi-boot-service-taking-40-seconds-on-rpi3b-and-pinea64/3772/21 "2020-01-24T11:16:46Z")

</div>

I could try some package recording, but not that weekend as I will be out. So probably next week I will be able to check.

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [26 January 2020 20:52 UTC](https://dietpi.com/forum/t/dietpi-boot-service-taking-40-seconds-on-rpi3b-and-pinea64/3772/22 "2020-01-26T20:52:36Z")

</div>

Hi,  
i did 2 reboots today. Both are done within an hour.

**first one**

```nohighlight
root@DietPi3:~# systemd-analyze blame
          1.236s dietpi-preboot.service
          1.107s dev-mmcblk0p2.device
           987ms dietpi-boot.service

```

**second one**

```nohighlight
root@DietPi3:~# systemd-analyze blame
         33.214s dietpi-boot.service
          1.230s dietpi-preboot.service
          1.100s dev-mmcblk0p2.device

```

Will do some logging on my router this week

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [31 January 2020 14:55 UTC](https://dietpi.com/forum/t/dietpi-boot-service-taking-40-seconds-on-rpi3b-and-pinea64/3772/23 "2020-01-31T14:55:01Z")

</div>

I just recognised that on our current images, systemd-timesyncd is enabled on first boot. I’ll search through the code, but is is probably enabled in your case as well? systemctl is-enabled systemd-timesyncd  
I’ll run some tests if it causes delays when time sync has been done already, before (when restarting the service) another sync is done.

Okay verified:

- DietPi-PREP does not touch the time sync mode (systemd-timesyncd is enabled)
- On first boot, first time sync happens automatically then once systemd-timesyncd finds connection.
- Then on login, DietPi-Login forces another time sync, restarting the service.
- Then DietPi-Software applies the chosen time sync mode during first run installs.

Hence issues due to two closely running time syncs can only happen on first boot. But needs cleanup:

- systemd-timesyncd should be disabled on fresh images, to match defaults
- Prior to login and such, the early firstrun script needs to apply the chosen time sync mode (and server) and enable the service, if chosen
- So DietPi-Login already handles things according to the chosen settings

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [31 January 2020 15:57 UTC](https://dietpi.com/forum/t/dietpi-boot-service-taking-40-seconds-on-rpi3b-and-pinea64/3772/24 "2020-01-31T15:57:14Z")

</div>

So finally I was able to trace the connection today. Attached the result. The filter is set for all communication from and to the RPi3B+. Capturing was started short before boot.

192.168.0.1 is my Internet Router / NTP Server  
192.168.0.11 is my PiHole running DHCP + DNS  
192.168.0.12 is the RPi3B+ client (hanging on boot)  
192.168.0.31 my desktop computer Win10

at 2 sec you see the DHCP request that get answered  
at 30 sec you see the NTP request.

Nothing happen in between, accept me trying to connect on port 22 ☹

[![](https://i.ibb.co/pQHhVHd/Unbenannt.png)](https://ibb.co/pQHhVHd)

```nohighlight
root@DietPi3:~# systemd-analyze blame
         33.425s dietpi-boot.service
          1.221s dietpi-preboot.service

```

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [31 January 2020 16:02 UTC](https://dietpi.com/forum/t/dietpi-boot-service-taking-40-seconds-on-rpi3b-and-pinea64/3772/25 "2020-01-31T16:02:39Z")

</div>

Quite strange. Actually, systemd-timesyncd, when started, should always send NTP requests immediately. What I anyway wanted to change by times, is omitting the systemd-timesyncd service and instead start the binary /lib/systemd/systemd-timesyncd directly. This needs to be done within an output parser (read), since this is a foreground process then. But actually the systemd service should do exactly the same 🤔.

[Previous page](https://dietpi.com/forum/t/dietpi-boot-service-taking-40-seconds-on-rpi3b-and-pinea64/3772.md?page=1)
