chiark / gitweb /
execute: bump up log level of executed processes that failed
authorLennart Poettering <lennart@poettering.net>
Sat, 17 Jul 2010 02:17:30 +0000 (04:17 +0200)
committerLennart Poettering <lennart@poettering.net>
Sat, 17 Jul 2010 02:17:30 +0000 (04:17 +0200)
fixme
src/log.h
src/mount.c
src/service.c
src/socket.c

diff --git a/fixme b/fixme
index 10573058bb9a827e51831a24ea3a874496873076..b80ea43a27c77bd052048e1f3b66065784e3215c 100644 (file)
--- a/fixme
+++ b/fixme
@@ -55,6 +55,8 @@
 
 * fingerprint.target, wireless.target, gps.target
 
+* fix merging of device units
+
 External:
 
 * default.target must be %ghosted...
index ed9b8c84d0f8f3ab8d57506ff15f9053d2821103..e5ea5310caa33472e258d08ef6d1d11159c1a043 100644 (file)
--- a/src/log.h
+++ b/src/log.h
@@ -83,6 +83,8 @@ int log_dump_internal(
         const char *func,
         char *buffer);
 
+#define log_full(level, ...) log_meta(level, __FILE__, __LINE__, __func__, __VA_ARGS__)
+
 #define log_debug(...)   log_meta(LOG_DEBUG,   __FILE__, __LINE__, __func__, __VA_ARGS__)
 #define log_info(...)    log_meta(LOG_INFO,    __FILE__, __LINE__, __func__, __VA_ARGS__)
 #define log_notice(...)  log_meta(LOG_NOTICE,  __FILE__, __LINE__, __func__, __VA_ARGS__)
index 5b0bc6bdf01e6f22343922d8cd1c034600479956..bee3c9a60ef001a669bb6cb063d4840137fbfd68 100644 (file)
@@ -962,7 +962,8 @@ static void mount_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                 m->control_command_id = _MOUNT_EXEC_COMMAND_INVALID;
         }
 
-        log_debug("%s control process exited, code=%s status=%i", u->meta.id, sigchld_code_to_string(code), status);
+        log_full(success ? LOG_DEBUG : LOG_NOTICE,
+                 "%s mount process exited, code=%s status=%i", u->meta.id, sigchld_code_to_string(code), status);
 
         /* Note that mount(8) returning and the kernel sending us a
          * mount table change event might happen out-of-order. If an
index 1bfab5013d0cfe2cfb61a74d7cd5c453a1191ac8..a5d1ebd84b6d780a41cecb0936b9e2da80d544ef 100644 (file)
@@ -2199,7 +2199,8 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                                 success = true;
                 }
 
-                log_debug("%s: main process exited, code=%s, status=%i", u->meta.id, sigchld_code_to_string(code), status);
+                log_full(success ? LOG_DEBUG : LOG_NOTICE,
+                         "%s: main process exited, code=%s, status=%i", u->meta.id, sigchld_code_to_string(code), status);
                 s->failure = s->failure || !success;
 
                 /* The service exited, so the service is officially
@@ -2256,7 +2257,8 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
 
                 s->control_pid = 0;
 
-                log_debug("%s: control process exited, code=%s status=%i", u->meta.id, sigchld_code_to_string(code), status);
+                log_full(success ? LOG_DEBUG : LOG_NOTICE,
+                         "%s: control process exited, code=%s status=%i", u->meta.id, sigchld_code_to_string(code), status);
                 s->failure = s->failure || !success;
 
                 /* If we are shutting things down anyway we
@@ -2476,7 +2478,7 @@ static void service_notify_message(Unit *u, pid_t pid, char **tags) {
              s->state == SERVICE_RELOAD)) {
 
                 if (parse_pid(e + 8, &pid) < 0)
-                        log_warning("Failed to parse %s", e);
+                        log_warning("Failed to parse notification message %s", e);
                 else {
                         log_debug("%s: got %s", u->meta.id, e);
                         service_set_main_pid(s, pid);
index 257a4e959ab60c4fcf612d5c89f882cc7711b5fb..4cf21cf0b181eec475fc9e564c8eacc80496439c 100644 (file)
@@ -1535,7 +1535,8 @@ static void socket_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                         success = true;
         }
 
-        log_debug("%s control process exited, code=%s status=%i", u->meta.id, sigchld_code_to_string(code), status);
+        log_full(success ? LOG_DEBUG : LOG_NOTICE,
+                 "%s control process exited, code=%s status=%i", u->meta.id, sigchld_code_to_string(code), status);
         s->failure = s->failure || !success;
 
         if (s->control_command && s->control_command->command_next && success) {