core: drop redundant logging about notification messages

Before:
May 12 17:11:22 tomegun-x2402 systemd[1]: systemd-udevd.service: Got notification message for unit.
May 12 17:11:22 tomegun-x2402 systemd[1]: systemd-udevd.service: Got notification message from PID 195 (READY=1)
May 12 17:11:22 tomegun-x2402 systemd[1]: systemd-udevd.service: Ggot READY=1

After:
May 12 17:11:22 tomegun-x2402 systemd[1]: systemd-udevd.service: Got notification message from PID 195 (READY=1)
This commit is contained in:
Tom Gundersen 2015-05-12 17:21:51 +02:00
parent 005e945cc4
commit 3495967790
2 changed files with 5 additions and 18 deletions

View file

@ -1496,10 +1496,10 @@ static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, char *
return; return;
} }
log_unit_debug(u, "Got notification message for unit.");
if (UNIT_VTABLE(u)->notify_message) if (UNIT_VTABLE(u)->notify_message)
UNIT_VTABLE(u)->notify_message(u, pid, tags, fds); UNIT_VTABLE(u)->notify_message(u, pid, tags, fds);
else
log_unit_debug(u, "Got notification message for unit. Ignoring.");
} }
static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t revents, void *userdata) { static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t revents, void *userdata) {

View file

@ -2818,20 +2818,18 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags, FDSet *fds)
assert(u); assert(u);
cc = strv_join(tags, ", "); cc = strv_join(tags, ", ");
log_unit_debug(u, "Got notification message from PID "PID_FMT" (%s)", pid, isempty(cc) ? "n/a" : cc);
if (s->notify_access == NOTIFY_NONE) { if (s->notify_access == NOTIFY_NONE) {
log_unit_warning(u, "Got notification message from PID "PID_FMT", but reception is disabled.", pid); log_unit_warning(u, "Got notification message from PID "PID_FMT", but reception is disabled.", pid);
return; return;
} } else if (s->notify_access == NOTIFY_MAIN && pid != s->main_pid) {
if (s->notify_access == NOTIFY_MAIN && pid != s->main_pid) {
if (s->main_pid != 0) if (s->main_pid != 0)
log_unit_warning(u, "Got notification message from PID "PID_FMT", but reception only permitted for main PID "PID_FMT, pid, s->main_pid); log_unit_warning(u, "Got notification message from PID "PID_FMT", but reception only permitted for main PID "PID_FMT, pid, s->main_pid);
else else
log_unit_debug(u, "Got notification message from PID "PID_FMT", but reception only permitted for main PID which is currently not known", pid); log_unit_debug(u, "Got notification message from PID "PID_FMT", but reception only permitted for main PID which is currently not known", pid);
return; return;
} } else
log_unit_debug(u, "Got notification message from PID "PID_FMT" (%s)", pid, isempty(cc) ? "n/a" : cc);
/* Interpret MAINPID= */ /* Interpret MAINPID= */
e = strv_find_startswith(tags, "MAINPID="); e = strv_find_startswith(tags, "MAINPID=");
@ -2839,8 +2837,6 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags, FDSet *fds)
if (parse_pid(e, &pid) < 0) if (parse_pid(e, &pid) < 0)
log_unit_warning(u, "Failed to parse MAINPID= field in notification message: %s", e); log_unit_warning(u, "Failed to parse MAINPID= field in notification message: %s", e);
else { else {
log_unit_debug(u, "Got MAINPID=%s", e);
service_set_main_pid(s, pid); service_set_main_pid(s, pid);
unit_watch_pid(UNIT(s), pid); unit_watch_pid(UNIT(s), pid);
notify_dbus = true; notify_dbus = true;
@ -2850,7 +2846,6 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags, FDSet *fds)
/* Interpret RELOADING= */ /* Interpret RELOADING= */
if (strv_find(tags, "RELOADING=1")) { if (strv_find(tags, "RELOADING=1")) {
log_unit_debug(u, "Got RELOADING=1");
s->notify_state = NOTIFY_RELOADING; s->notify_state = NOTIFY_RELOADING;
if (s->state == SERVICE_RUNNING) if (s->state == SERVICE_RUNNING)
@ -2862,7 +2857,6 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags, FDSet *fds)
/* Interpret READY= */ /* Interpret READY= */
if (strv_find(tags, "READY=1")) { if (strv_find(tags, "READY=1")) {
log_unit_debug(u, "Ggot READY=1");
s->notify_state = NOTIFY_READY; s->notify_state = NOTIFY_READY;
/* Type=notify services inform us about completed /* Type=notify services inform us about completed
@ -2881,7 +2875,6 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags, FDSet *fds)
/* Interpret STOPPING= */ /* Interpret STOPPING= */
if (strv_find(tags, "STOPPING=1")) { if (strv_find(tags, "STOPPING=1")) {
log_unit_debug(u, "Got STOPPING=1");
s->notify_state = NOTIFY_STOPPING; s->notify_state = NOTIFY_STOPPING;
if (s->state == SERVICE_RUNNING) if (s->state == SERVICE_RUNNING)
@ -2899,8 +2892,6 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags, FDSet *fds)
if (!utf8_is_valid(e)) if (!utf8_is_valid(e))
log_unit_warning(u, "Status message in notification message is not UTF-8 clean."); log_unit_warning(u, "Status message in notification message is not UTF-8 clean.");
else { else {
log_unit_debug(u, "Got STATUS=%s", e);
t = strdup(e); t = strdup(e);
if (!t) if (!t)
log_oom(); log_oom();
@ -2925,8 +2916,6 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags, FDSet *fds)
if (safe_atoi(e, &status_errno) < 0 || status_errno < 0) if (safe_atoi(e, &status_errno) < 0 || status_errno < 0)
log_unit_warning(u, "Failed to parse ERRNO= field in notification message: %s", e); log_unit_warning(u, "Failed to parse ERRNO= field in notification message: %s", e);
else { else {
log_unit_debug(u, "Got ERRNO=%s", e);
if (s->status_errno != status_errno) { if (s->status_errno != status_errno) {
s->status_errno = status_errno; s->status_errno = status_errno;
notify_dbus = true; notify_dbus = true;
@ -2936,13 +2925,11 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags, FDSet *fds)
/* Interpret WATCHDOG= */ /* Interpret WATCHDOG= */
if (strv_find(tags, "WATCHDOG=1")) { if (strv_find(tags, "WATCHDOG=1")) {
log_unit_debug(u, "Got WATCHDOG=1");
service_reset_watchdog(s); service_reset_watchdog(s);
} }
/* Add the passed fds to the fd store */ /* Add the passed fds to the fd store */
if (strv_find(tags, "FDSTORE=1")) { if (strv_find(tags, "FDSTORE=1")) {
log_unit_debug(u, "Got FDSTORE=1");
service_add_fd_store_set(s, fds); service_add_fd_store_set(s, fds);
} }