[systemd-devel] Help regarding service dependency
Amit Saha
asaha at redhat.com
Thu Mar 13 18:25:34 PDT 2014
Hello,
We have service1 which starts in default.target, and we want it to start After service2
(systemd-readahead-done) which starts after the default.target is reached.
So, I think what would happen in this case is the After=service2 for service1 is ignored
and it is started before service2 since the default.target must be reached.
For more specific info, here is a snippet of the .timer file for service2:
[Unit]
Description=Stop Read-Ahead Data Collection 10s After Completed Startup
Documentation=man:systemd-readahead-replay.service(8)
DefaultDependencies=no
Conflicts=shutdown.target
After=default.target
Before=shutdown.target
ConditionVirtualization=no
[Timer]
OnActiveSec=30s
A colleague suggested creating a new target for service1 which
the system boots into and has a After=default.target, systemd-readahead-done.service.
Even if not exactly how I mention, this idea holds promise.
Also, is there any other suggested solution involving fiddling with the unit dependencies
but not the system boot target?
Thanks,
Amit.
More information about the systemd-devel
mailing list