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

Having issues with your DietPi installation, or, found a bug? Post it here.
kamilmirza
Posts: 13
Joined: Tue Mar 21, 2017 10:13 am

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

Post 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

User avatar
Joulinar
Posts: 1780
Joined: Sat Nov 16, 2019 12:49 am

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

Post 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
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team

att2
Posts: 14
Joined: Tue Jan 07, 2020 12:42 pm

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

Post by att2 »

Please read this :

viewtopic.php?f=11&t=7181


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

kamilmirza
Posts: 13
Joined: Tue Mar 21, 2017 10:13 am

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

Post by kamilmirza »

att2 wrote:
Sun Jan 19, 2020 4: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

kamilmirza
Posts: 13
Joined: Tue Mar 21, 2017 10:13 am

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

Post by kamilmirza »

Joulinar wrote:
Sat Jan 18, 2020 11: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?

User avatar
Joulinar
Posts: 1780
Joined: Sat Nov 16, 2019 12:49 am

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

Post 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 :?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team

att2
Posts: 14
Joined: Tue Jan 07, 2020 12:42 pm

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

Post by att2 »

kamilmirza wrote:
Sun Jan 19, 2020 7:52 pm
att2 wrote:
Sun Jan 19, 2020 4: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 !!!

User avatar
Joulinar
Posts: 1780
Joined: Sat Nov 16, 2019 12:49 am

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

Post 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.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team

kamilmirza
Posts: 13
Joined: Tue Mar 21, 2017 10:13 am

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

Post 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)

User avatar
Joulinar
Posts: 1780
Joined: Sat Nov 16, 2019 12:49 am

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

Post 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
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team

Post Reply