umbrel icon indicating copy to clipboard operation
umbrel copied to clipboard

Update umbrel-startup.service BindsTo=docker

Open j4Hu opened this issue 2 years ago • 0 comments

sometimes umbrel is not working when docker service restarts, (commonly on auto update and restart).

this change binds docker+umbrel-startup services together more tightly.

before: when i stop docker, umbrel is still running without containers.

after: when i stop docker, umbrel is stopped.

DOC: "BindsTo=

Configures requirement dependencies, very similar in style to Requires=. However, this dependency type is stronger: in addition to the effect of Requires= it declares that if the unit bound to is stopped, this unit will be stopped too. This means a unit bound to another unit that suddenly enters inactive state will be stopped too. Units can suddenly, unexpectedly enter inactive state for different reasons: the main process of a service unit might terminate on its own choice, the backing device of a device unit might be unplugged or the mount point of a mount unit might be unmounted without involvement of the system and service manager.

When used in conjunction with After= on the same unit the behaviour of BindsTo= is even stronger. In this case, the unit bound to strictly has to be in active state for this unit to also be in active state. This not only means a unit bound to another unit that suddenly enters inactive state, but also one that is bound to another unit that gets skipped due to a failed condition check (such as ConditionPathExists=, ConditionPathIsSymbolicLink=, … — see below) will be stopped, should it be running. Hence, in many cases it is best to combine BindsTo= with After=."

j4Hu avatar Sep 12 '23 09:09 j4Hu