Be more verbose when bind or listen fails
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 4 Mar 2014 00:49:40 +0000 (19:49 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 19 Jul 2014 01:44:59 +0000 (21:44 -0400)
Also be more verbose in devnode_acl_all().

src/core/manager.c
src/journal/journald-native.c
src/journal/journald-stream.c
src/journal/journald-syslog.c
src/login/logind-acl.c
src/shared/ask-password-api.c

index e7a3a2a..9d9a713 100644 (file)
@@ -554,7 +554,7 @@ static int manager_setup_notify(Manager *m) {
                 strncpy(sa.un.sun_path, m->notify_socket, sizeof(sa.un.sun_path)-1);
                 r = bind(fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path));
                 if (r < 0) {
-                        log_error("bind() failed: %m");
+                        log_error("bind(@%s) failed: %m", sa.un.sun_path+1);
                         return -errno;
                 }
 
index 6674f3b..0f3936a 100644 (file)
@@ -404,7 +404,7 @@ int server_open_native_socket(Server*s) {
 
                 r = bind(s->native_fd, &sa.sa, offsetof(union sockaddr_union, un.sun_path) + strlen(sa.un.sun_path));
                 if (r < 0) {
-                        log_error("bind() failed: %m");
+                        log_error("bind(%s) failed: %m", sa.un.sun_path);
                         return -errno;
                 }
 
index 89da150..8a983d8 100644 (file)
@@ -450,14 +450,14 @@ int server_open_stdout_socket(Server *s) {
 
                 r = bind(s->stdout_fd, &sa.sa, offsetof(union sockaddr_union, un.sun_path) + strlen(sa.un.sun_path));
                 if (r < 0) {
-                        log_error("bind() failed: %m");
+                        log_error("bind(%s) failed: %m", sa.un.sun_path);
                         return -errno;
                 }
 
                 chmod(sa.un.sun_path, 0666);
 
                 if (listen(s->stdout_fd, SOMAXCONN) < 0) {
-                        log_error("listen() failed: %m");
+                        log_error("listen(%s) failed: %m", sa.un.sun_path);
                         return -errno;
                 }
         } else
index afeb8bd..656dc72 100644 (file)
@@ -441,7 +441,7 @@ int server_open_syslog_socket(Server *s) {
 
                 r = bind(s->syslog_fd, &sa.sa, offsetof(union sockaddr_union, un.sun_path) + strlen(sa.un.sun_path));
                 if (r < 0) {
-                        log_error("bind() failed: %m");
+                        log_error("bind(%s) failed: %m", sa.un.sun_path);
                         return -errno;
                 }
 
index 4bbeb64..af7c352 100644 (file)
@@ -277,7 +277,10 @@ int devnode_acl_all(struct udev *udev,
         SET_FOREACH(n, nodes, i) {
                 int k;
 
-                log_debug("Fixing up ACLs at %s for seat %s", n, seat);
+                log_debug("Changing ACLs at %s for seat %s (uid "UID_FMT"→"UID_FMT"%s%s)",
+                          n, seat, old_uid, new_uid,
+                          del ? " del" : "", add ? " add" : "");
+
                 k = devnode_acl(n, flush, del, old_uid, add, new_uid);
                 if (k == -ENOENT)
                         log_debug("Device %s disappeared while setting ACLs", n);
index 5997a03..8d03f4a 100644 (file)
@@ -270,7 +270,7 @@ static int create_socket(char **name) {
 
         if (r < 0) {
                 r = -errno;
-                log_error("bind() failed: %m");
+                log_error("bind(%s) failed: %m", sa.un.sun_path);
                 goto fail;
         }