chiark / gitweb /
unit: fix the race in deserialization.
authorOleksii Shevchuk <alxchk@gmail.com>
Wed, 13 Feb 2013 22:49:26 +0000 (00:49 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2013 14:11:35 +0000 (15:11 +0100)
commitbf6dcfa6a79a459239799a21bdcba115d696a006
tree2df71621bb582c5d800305a494e3d5c0cfed22ee
parent92094b75fb8629492cddab1677a29830a7d96811
unit: fix the race in deserialization.

unit_notify is fired in deserelization code (particulary in
service_set_state). Units passed in random order, and there is possibility,
that unit with StopWhenUnneeded=yes passed before it actual dependecies. In
that case unit will be stopped as unneeded, because deps in UNIT_INACTIVE state
yet.

So, reuse similar logic (unit.c:1421) to avoid this race
src/core/unit.c