Skip to content

Commit

Permalink
No idle timer when not socket activated
Browse files Browse the repository at this point in the history
The idle timer should definitely be disabled when socket activation is
not being used. Insure that the idel hadler does not set up events
when the daemon is not in userprocy mode, and further ensure that
termination is disabled when a regular socket is initialized.

Signed-off-by: Simo Sorce <simo@redhat.com>
  • Loading branch information
simo5 committed Jun 5, 2022
1 parent aa69273 commit 7acb54f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/gp_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ static verto_ev *setup_socket(struct gssproxy_ctx *gpctx, char *sock_name,
}
#endif
if (!sock_ctx) {
/* disable self termination as we are not socket activated */
gpctx->term_timeout = 0;

/* no activation, try regular socket creation */
sock_ctx = init_unix_socket(gpctx, sock_name);
}
Expand Down
2 changes: 1 addition & 1 deletion src/gp_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void idle_handler(struct gssproxy_ctx *gpctx)
/* we've been called, this means some event just fired,
* restart the timeout handler */

if (gpctx->term_timeout == 0) {
if (gpctx->userproxymode == false || gpctx->term_timeout == 0) {
/* self termination is disabled */
return;
}
Expand Down
3 changes: 0 additions & 3 deletions src/gp_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ int init_activation_socket(struct gssproxy_ctx *gpctx,
_sock_ctx->fd = fd;

*sock_ctx = _sock_ctx;
} else {
/* disable self termination as we are not socket activated */
gpctx->term_timeout = 0;
}

done:
Expand Down

0 comments on commit 7acb54f

Please sign in to comment.