Merge branch 'pulse_server_sd_socket_log' into 'master'

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

See merge request pipewire/pipewire!2103
This commit is contained in:
Barnabás Pőcze 2025-10-17 16:14:02 +02:00
commit 0ab83d0684

View file

@ -580,21 +580,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
@ -614,6 +619,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;
}