[systemd-devel] Dependencies on targets

Pathangi Janardhanan path.jana at gmail.com
Tue Feb 9 22:55:45 CET 2016


Hi All,

 I have a target t1, which has three services associated with it, t11, t12
and t13. The service dependencies After etc. I have in the individual t11,
t12 and t13 unit files

 I have another target t2, which has two service associated with it t21,
t22. I want all units associated with target t2 to start only after all
units in target t1 are ready.

 So in t2.target , i have
 Requires=t1.target
 After=t1.target

 and in the t21.service and t22.service, I have
 Wants=t2.target

and in Install section
 WantedBy=t2.target

 But with this I find all the services that I want associated with t2,
start right along with the services in t1.

 If I change the t21.service and t22.service to include

 Requires=t2.target
 After=t2.target

 Things work as expected, i.e. all services in t1.target get started and
ready before services t21 and t22 are started

 So I would like to know if this is the correct way to order the dependency
on the target, because if say After=t2.target, though it is actually (at
least my intention) is that this service is associated with t2.target.

I have also attached all the service and target files for reference.

Thanks
Jana
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160209/0e2c5950/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t1.target
Type: application/octet-stream
Size: 73 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160209/0e2c5950/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t2.target
Type: application/octet-stream
Size: 109 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160209/0e2c5950/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t11.service
Type: application/octet-stream
Size: 145 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160209/0e2c5950/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t12.service
Type: application/octet-stream
Size: 186 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160209/0e2c5950/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t13.service
Type: application/octet-stream
Size: 185 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160209/0e2c5950/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t21.service
Type: application/octet-stream
Size: 181 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160209/0e2c5950/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t22.service
Type: application/octet-stream
Size: 181 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160209/0e2c5950/attachment-0006.obj>


More information about the systemd-devel mailing list