Page 1 of 3

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

Posted: Sat Jan 18, 2020 9:40 pm
by kamilmirza
I am facing huge after-boot delay on fresh install of dietpi (brand new Transcend UHS-1 sdcard, official power supply) on rpi3B and pinea64
after reading MOTD, I tried systemd-analyze blame command:

Code: Select all

[email protected]:~# systemd-analyze blame
         41.423s dietpi-boot.service
          1.371s ddclient.service
          1.234s dietpi-preboot.service
          1.229s dev-mmcblk0p2.device
          ...
what should I do to minimize dietpi-boot.service time? :?

here's my dietpi-boot.service:

Code: Select all

[email protected]:~# cat /etc/systemd/system/dietpi-boot.service
[Unit]
Description=DietPi-Boot
# Order 3
Requisite=dietpi-preboot.service
After=dietpi-preboot.service network.target
Before=getty-pre.target [email protected] getty.target ssh.service dropbear.service

[Service]
Type=oneshot
RemainAfterExit=yes
StandardOutput=tty
ExecStart=/bin/dash -c '/DietPi/dietpi/boot 2>&1 | tee /tmp/dietpi-boot.log'

[Install]
WantedBy=multi-user.target

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

Posted: Sat Jan 18, 2020 10:09 pm
by Joulinar
Hi,
many thanks for your report.

It's coming most likely from NTP time sync during boot. For testing purposes you could deactivate NTP time sync within dietpi.txt and reboot your system.

Similar was reported here

viewtopic.php?f=11&t=7126

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

Posted: Sun Jan 19, 2020 3:55 pm
by att2
Please read this :

viewtopic.php?f=11&t=7181


Change the service to type "forking" !!!
No slow boot anymore!

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

Posted: Sun Jan 19, 2020 6:52 pm
by kamilmirza
att2 wrote:
Sun Jan 19, 2020 3:55 pm
Please read this :

viewtopic.php?f=11&t=7181


Change the service to type "forking" !!!
No slow boot anymore!
tried this but no gain
disabled NTP on boot and it reduced to 5s

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

Posted: Sun Jan 19, 2020 7:01 pm
by kamilmirza
Joulinar wrote:
Sat Jan 18, 2020 10:09 pm
Hi,
many thanks for your report.

It's coming most likely from NTP time sync during boot. For testing purposes you could deactivate NTP time sync within dietpi.txt and reboot your system.

Similar was reported here

viewtopic.php?f=11&t=7126
thanks! this solved the issue :D
by disbaling NTP sync, should I be worried because I run pihole on my rpi3B?

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

Posted: Sun Jan 19, 2020 7:09 pm
by Joulinar
Hi,
yes indeed, disabling NTP might not be the best idea as you are missing the time sync. But the question is, does it hurt your to wait for 40 seconds on boot? How often you are going to reboot? I personally decided by my own to keep NTP aktive as I reboot my prod system just rarely. As well I noticed that on some of my systems it seems to be gone after a few weeks. But still I have no clue why and how :?

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

Posted: Sun Jan 19, 2020 8:31 pm
by att2
kamilmirza wrote:
Sun Jan 19, 2020 6:52 pm
att2 wrote:
Sun Jan 19, 2020 3:55 pm
Please read this :

viewtopic.php?f=11&t=7181


Change the service to type "forking" !!!
No slow boot anymore!
tried this but no gain
disabled NTP on boot and it reduced to 5s
Did you do a "systemctl daemon-reload" after changing the systemd config file to "forked" mode ?

And yes slow booting hurts a lot, especially on devices which are frequently turned on or off !!!

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

Posted: Mon Jan 20, 2020 3:04 pm
by Joulinar
@kamilmirza
I discovered the following, changing IP address from DHCP to STATIC seems to have a positive impact as well

Ethernet set to DHCP

Code: Select all

[email protected]:~# systemd-analyze blame
         30.981s dietpi-boot.service
Ethernet set to STATIC

Code: Select all

[email protected]:~# systemd-analyze blame
          1.941s dietpi-boot.service
Basically there is no need to disable NTP. Just switch to a static IP seems to fix it as well. At least on my RPi3B. However still a strange topic.

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

Posted: Mon Jan 20, 2020 9:15 pm
by kamilmirza
@Joulinar
nope switching to STATIC IP did not help

Code: Select all

[email protected]:~# systemd-analyze blame
         40.449s dietpi-boot.service
have rpi3B here, as well
NTP mode is at 2 (default)

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

Posted: Mon Jan 20, 2020 9:18 pm
by Joulinar
still quite strange topic. it seems completely random. The only thing we know, it depends on NTP and how fast it can update. Be we don't know why NTP is hanging in our cases. :?

btw: NTP mode for me is GateWay as my Router is providing this function. Anyway I guess this doesn't have any impact