Skip to content

Commit

Permalink
Allow to specify the listening socket fd
Browse files Browse the repository at this point in the history
through the SPEECHD_SOCK_FD environment variable.
  • Loading branch information
mohd-akram authored and sthibaul committed May 9, 2024
1 parent ab0ee54 commit 799b3b8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/server/speechd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1337,13 +1337,17 @@ int main(int argc, char *argv[])
g_free(spawn_socket_path);
}

char *sock_fd = getenv("SPEECHD_SOCK_FD");
if (sock_fd) {
server_socket = atoi(sock_fd);
}
#ifdef USE_LIBSYSTEMD
if (sd_listen_fds(0) >= 1) {
else if (sd_listen_fds(0) >= 1) {
MSG(4, "Daemon launched via Systemd socket activation");
server_socket = SD_LISTEN_FDS_START;
} else
}
#endif
if (!strcmp(SpeechdOptions.communication_method, "inet_socket")) {
else if (!strcmp(SpeechdOptions.communication_method, "inet_socket")) {
MSG(4, "Speech Dispatcher will use inet port %d",
SpeechdOptions.port);
/* Connect and start listening on inet socket */
Expand Down

0 comments on commit 799b3b8

Please sign in to comment.