]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Return -EAGAIN instead of -EALREADY from unit_reload 11506/head
authorJonathon Kowalski <bl0pbl33p@gmail.com>
Sun, 20 Jan 2019 22:12:24 +0000 (22:12 +0000)
committerJonathon Kowalski <bl0pbl33p@gmail.com>
Sun, 20 Jan 2019 22:12:24 +0000 (22:12 +0000)
Fixes: #11499
Let's return -EAGAIN so that on state change, unit_process_job tries to
add our job to run_queue again so that all the reloads that coalesced
into the installed reload (which itself merged into a running one)
inititally atleast runs *once*. This should ensure service picks up all
config changes reliably.

See the issue being fixed for a detailed explanation.

src/core/unit.c

index 24b14fbcd63759791cebea6882e3f1d1df1cbd10..f4888ff45016392090628d8b90e08819ad3c0c68 100644 (file)
@@ -1895,7 +1895,7 @@ int unit_reload(Unit *u) {
 
         state = unit_active_state(u);
         if (state == UNIT_RELOADING)
-                return -EALREADY;
+                return -EAGAIN;
 
         if (state != UNIT_ACTIVE) {
                 log_unit_warning(u, "Unit cannot be reloaded because it is inactive.");