<div dir="ltr"><div>Is it generally considered bad form to start up a service unit from within an application? </div><div><br></div><div>I have been trying to keep everything under the direct control of systemd, but I ran in to a problem that I am not quite sure how to resolve and still keep systemd in control of everything.</div><div><br></div><div>I have a daemon service that absolutely cannot be started until a test passes. I also do not have the ability to alter this daemon, except for overriding its service unit with drop-ins.</div><div><br></div><div>The test depends on another server that might be up, or it could possibly be down for days.</div><div><br></div><div>One possibility is to set up "foo-test.service" with Type=oneshot whose ExecStart= does not exit until the test passes. By amending the dependent service with After=foo-test.service and Requires=foo-test.service I solve the problem. <br></div><div><div><br></div><div>But the target unit does not finish until service foo-test.service finishes - systemctl list-jobs shows the jobs. This would be all well and good, but our environment dictates that we occasionally isolate to a different target. With jobs waiting, we cannot isolate to a different target.</div><div><br></div><div>Should I just go ahead and set Type=simple in service foo-test.service and bury "systemctl start foo.service" in the script called from ExecStart= once the test passes?</div><div><br></div><div>Or is there a way to solve the "Long Running Startup Dependency" problem purely in systemd? It seems like "AfterOneshot=" should exist, which treats the parent as a Type=oneshot even if it is Type=simple.</div><div><br></div><div>..Ch:W..</div><div><br></div></div></div>