Add support for systemd socket activation (where systemd creates the Unix

domain socket for tmux rather than tmux creating it). Build with
--enable-systemd. From Julien Moutinho in GitHub issue 3119.
This commit is contained in:
Nicholas Marriott
2022-03-28 08:42:13 +01:00
parent d26a4ea463
commit fc7f1e7acb
6 changed files with 99 additions and 1 deletions

View File

@ -100,7 +100,7 @@ server_check_marked(void)
}
/* Create server socket. */
static int
int
server_create_socket(int flags, char **cause)
{
struct sockaddr_un sa;
@ -214,7 +214,11 @@ server_start(struct tmuxproc *client, int flags, struct event_base *base,
gettimeofday(&start_time, NULL);
#ifdef HAVE_SYSTEMD
server_fd = systemd_create_socket(flags, &cause);
#else
server_fd = server_create_socket(flags, &cause);
#endif
if (server_fd != -1)
server_update_socket();
if (~flags & CLIENT_NOFORK)