From f3b900311f1f6ed10adfc8e86267a2fbc4e1fb7b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 27 Nov 2017 16:58:46 +0100 Subject: [PATCH] service: shortcut operations if the MAINPID= doesn't actually cause a change --- src/core/service.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/service.c b/src/core/service.c index e7e65d4270a..e7a829a564f 100644 --- a/src/core/service.c +++ b/src/core/service.c @@ -3386,7 +3386,7 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags, FDSet *fds) log_unit_warning(u, "A control process cannot also be the main process"); else if (pid == getpid_cached() || pid == 1) log_unit_warning(u, "Service manager can't be main process, ignoring sd_notify() MAINPID= field"); - else { + else if (pid != s->main_pid) { service_set_main_pid(s, pid); unit_watch_pid(UNIT(s), pid); notify_dbus = true; -- 2.47.3