I am looking for a way to instruct systemd to recalculate service dependencies while the system is booting. Specifically, I need one service to be able to enable another service, and have the second service start up later in the same boot sequence. This is part of my automatic deployment process; very early in the boot process, the first time the system starts up, it automatically configures itself. One of the steps that it may need to take is enabling other services. Unfortunately, any changes it makes at that step do not seem to take effect until the following reboot. Rebooting the machine after initial deployment is not an option.Here's a generalized idea of what I'm trying to achieve/etc/systemd/system/firstboot.service:[Unit]Description=Enable MyServiceDefaultDependencies=noAfter=sysinit.targetBefore=basic.target[Service]Type=oneshotExecStart=/bin/systemctl enable myservice.serviceExecStartPost=/bin/systemctl disable firstboot.service[Install]RequiredBy=basic.target/etc/systemd/system/myservice.service:[Unit]Description=MyService[Service]Type=simpleExecStart=/usr/local/bin/myservice[Install]WantedBy=multi-user.targetUnfortunately, this doesn't work as I expected; the service is enabled, but is not started before multi-user.target:$ systemctl status myservicemyservice.service - MyService   Loaded: loaded (/etc/systemd/system/myservice.service; enabled)   Active: inactive (dead)I can force it to start with systemctl isolate multi-user.target or by rebooting the machine.I have tried adding systemctl daemon-reload and/or systemctl daemon-reexec to ExecStart/ExecStartPost of firstboot.service, but neither seem to have any effect.Is there any way I can tell systemd to recalculate the boot path and include the changes that were made while it was still booting? Or will I need to do something later in the boot process to force my service to start?
Changing systemd dependencies during boot
systemd