diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-09-29 16:07:41 +0200 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-10-21 18:23:38 -0400 |
commit | 7f8703da60625c577fd819268ebd3490d43f1792 (patch) | |
tree | a058f6d3b9dc28d6baeef131f54138b6c2af905c /src | |
parent | 227f781c630c43ec6229a5cd47c8c94acb370b34 (diff) |
pid1: more informative error message for ignored notificationssystemd/v231-2
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')
-rw-r--r-- | src/core/manager.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index b3a55e4ed6..7b20531d68 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -1599,8 +1599,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) { |