Skip to content

Commit 7acb54f

Browse files
committed
No idle timer when not socket activated
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>
1 parent aa69273 commit 7acb54f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/gp_init.c

+3
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ static verto_ev *setup_socket(struct gssproxy_ctx *gpctx, char *sock_name,
151151
}
152152
#endif
153153
if (!sock_ctx) {
154+
/* disable self termination as we are not socket activated */
155+
gpctx->term_timeout = 0;
156+
154157
/* no activation, try regular socket creation */
155158
sock_ctx = init_unix_socket(gpctx, sock_name);
156159
}

src/gp_mgmt.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void idle_handler(struct gssproxy_ctx *gpctx)
2828
/* we've been called, this means some event just fired,
2929
* restart the timeout handler */
3030

31-
if (gpctx->term_timeout == 0) {
31+
if (gpctx->userproxymode == false || gpctx->term_timeout == 0) {
3232
/* self termination is disabled */
3333
return;
3434
}

src/gp_socket.c

-3
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,6 @@ int init_activation_socket(struct gssproxy_ctx *gpctx,
219219
_sock_ctx->fd = fd;
220220

221221
*sock_ctx = _sock_ctx;
222-
} else {
223-
/* disable self termination as we are not socket activated */
224-
gpctx->term_timeout = 0;
225222
}
226223

227224
done:

0 commit comments

Comments
 (0)