service: shortcut operations if the MAINPID= doesn't actually cause a change

This commit is contained in:
Lennart Poettering
2017-11-27 17:04:57 +01:00
parent 2fa40742a4
commit f3b900311f
+1 -1
View File
@@ -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;