summaryrefslogtreecommitdiff
path: root/src/core/manager.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-09-29 16:07:41 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-09-29 16:08:19 +0200
commit6bd74eb055ad278904d152b08e26d5ad4241ddb0 (patch)
tree7d8c14bd1f07bcdf7e75f334a43661a7e3bffb46 /src/core/manager.c
parentb2922837d67a4bf66c7862b06eb5b513a7fe6ef6 (diff)
pid1: more informative error message for ignored notificationssystemd/v231-2-backport2
It's probably easier to diagnose a bad notification message if the contents are printed. But still, do anything only if debugging is on.
Diffstat (limited to 'src/core/manager.c')
-rw-r--r--src/core/manager.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/manager.c b/src/core/manager.c
index 512b6dc158..053b3a614b 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -1672,8 +1672,14 @@ static void manager_invoke_notify_message(Manager *m, Unit *u, pid_t pid, const
if (UNIT_VTABLE(u)->notify_message)
UNIT_VTABLE(u)->notify_message(u, pid, tags, fds);
- else
- log_unit_debug(u, "Got notification message for unit. Ignoring.");
+ else if (_unlikely_(log_get_max_level() >= LOG_DEBUG)) {
+ _cleanup_free_ char *x = NULL, *y = NULL;
+
+ x = cescape(buf);
+ if (x)
+ y = ellipsize(x, 20, 90);
+ log_unit_debug(u, "Got notification message \"%s\", ignoring.", strnull(y));
+ }
}
static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t revents, void *userdata) {