Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Fix slow DuetControlService startup

    Scheduled Pinned Locked Moved
    DSF Development
    2
    3
    250
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • oliofundefined
      oliof
      last edited by

      Hi,
      on my RPi 3B+ for some reason startup times are slow enough that my duet3 board has booted up before DCS is up and running. This means that config.g isn't loaded, leaving all fans running at blast and especially the toolboard unconfigured. After running M98 P"config.g" I finally succumbed to reading up on speeding up boot times on the raspberry pi, but I seem to be good already with about 8seconds .... but not good enough for Duet3 in SBC mode.

      So I looked into systemd a bit, and adding DefaultDependencies=false to the unit section seems to start up DCS early enough for the duet3 board to be able to get all the files before deciding it's unconfigured.

      My printer seems to boot up more reliable and without requiring manual intervention after this change. Are there any specific dependencies that have to be up before DCS gets started?

      <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

      oliofundefined 1 Reply Last reply Reply Quote 2
      • oliofundefined
        oliof @oliof
        last edited by

        For everyone that wants to try this on their RPi, edit the startup definition using
        systemctl edit duetcontrolserver
        and put the following in the editor that opens:

        [Unit]
        DefaultDependencies=false
        

        That way, the system files stay unmodified and the change survives package updates.

        Unless there is confirmation from @chrishamm that this is no problem, proceed at your own risk.

        <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

        1 Reply Last reply Reply Quote 1
        • chrishammundefined
          chrishamm administrators
          last edited by chrishamm

          Thanks for that tweak, I'll give it a try on my setup. It may lead to conflicts with plugins but perhaps it's a good idea to start them later anyway using a separate systemd unit.

          Edit: It looks like this switch just removes all the default dependencies, which isn't 100% desirable (e.g. it prevents proper shutdown of DCS). But it looks like we don't need to wait for basic.target to be fully started so I'll check which of the underlying units are actually required (probably sysinit.target or at least sub-units of that).

          Duet software engineer

          1 Reply Last reply Reply Quote 1
          • First post
            Last post
          Unless otherwise noted, all forum content is licensed under CC-BY-SA