Fix slow DuetControlService startup



  • 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?



  • 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.


  • administrators

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


Log in to reply