summaryrefslogtreecommitdiff
path: root/src/core/service.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-30 11:21:56 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-01-02 19:45:47 -0500
commitda13d4d20f8ca12e86863abbae5ed47bca936828 (patch)
tree4fdc24c8de618cb1697431eda4e59808235d86d9 /src/core/service.c
parenta9244623f785f504f799407b0228dea9655e24cb (diff)
core/service: check if mainpid matches only if it is set
https://bugzilla.redhat.com/show_bug.cgi?id=1047304
Diffstat (limited to 'src/core/service.c')
-rw-r--r--src/core/service.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/service.c b/src/core/service.c
index eb9cd234a9..ea47a5e327 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -3343,6 +3343,9 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) {
assert(u);
+ log_debug_unit(u->id, "%s: Got notification message from PID %lu (%s...)",
+ u->id, (unsigned long) pid, tags && *tags ? tags[0] : "(empty)");
+
if (s->notify_access == NOTIFY_NONE) {
log_warning_unit(u->id,
"%s: Got notification message from PID %lu, but reception is disabled.",
@@ -3350,15 +3353,13 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) {
return;
}
- if (s->notify_access == NOTIFY_MAIN && pid != s->main_pid) {
+ if (s->notify_access == NOTIFY_MAIN && s->main_pid != 0 && pid != s->main_pid) {
log_warning_unit(u->id,
"%s: Got notification message from PID %lu, but reception only permitted for PID %lu",
u->id, (unsigned long) pid, (unsigned long) s->main_pid);
return;
}
- log_debug_unit(u->id, "%s: Got message", u->id);
-
/* Interpret MAINPID= */
if ((e = strv_find_prefix(tags, "MAINPID=")) &&
(s->state == SERVICE_START ||