this post was submitted on 23 Jun 2024
9 points (100.0% liked)
Docker
1100 readers
2 users here now
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It does need both.
Requires=
alone will only pull the unit as a dependency and will activate it, but doesn't define a hard dependency. You need theAfter=
to also declare that the unit must be started after its dependencies are finished loading, not merely being activated. Otherwise they will start in parallel, it just guarantees that both units will be activated. There's an even stronger directive,BindsTo=
, that will tie them such that if its dependency is stopped, this unit will be deactivated too. If SMB is a hard dependency that might be preferable. Requires+After still allows the mount to fail, but ensures if it's mountable it'll be mounted before Docker, whereas with BindsTo+After, failing the SMB mount would also shut down Docker.