pulse-server: add more logging related to systemd socket activation

See #4117
This commit is contained in:
Barnabás Pőcze 2024-08-15 22:17:44 +02:00
parent d4de97a473
commit 2c42d4c1cf

View file

@ -546,21 +546,26 @@ static bool is_stale_socket(int fd, const struct sockaddr_un *addr_un)
#ifdef HAVE_SYSTEMD
static int check_systemd_activation(const char *path)
{
const int n = sd_listen_fds(0);
const int n = sd_listen_fds(false);
if (n < 0)
return n;
for (int i = 0; i < n; i++) {
const int fd = SD_LISTEN_FDS_START + i;
if (sd_is_socket_unix(fd, SOCK_STREAM, 1, path, 0) > 0)
int res = sd_is_socket_unix(fd, SOCK_STREAM, true, path, 0);
pw_log_debug("sd_is_socket_unix(%d, \"%s\"): %d", fd, path, res);
if (res > 0)
return fd;
}
return -1;
return -ENOENT;
}
#else
static inline int check_systemd_activation(SPA_UNUSED const char *path)
{
return -1;
return -EOPNOTSUPP;
}
#endif
@ -580,6 +585,8 @@ static int start_unix_server(struct server *server, const struct sockaddr_storag
goto done;
}
else {
pw_log_debug("server %p: no systemd socket activation socket found for '%s': %s",
server, addr_un->sun_path, spa_strerror(fd));
server->activated = false;
}