Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No idle timer when not socket activated #57

Merged
merged 3 commits into from
Jun 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential autopoint clang gcc docbook-{xsl,xml} libxml2-utils xml-core xsltproc lib{krb5,ini-config,keyutils,popt,selinux1,verto}-dev lib{nss,socket}-wrapper python3{,-colorama} valgrind krb5-{kdc,admin-server,kdc-ldap} ldap-utils slapd apparmor-utils
sudo apt-get install -y build-essential autopoint clang gcc docbook-{xsl,xml} libxml2-utils xml-core xsltproc lib{krb5,ini-config,keyutils,popt,selinux1,systemd,verto}-dev lib{nss,socket}-wrapper python3{,-colorama} valgrind krb5-{kdc,admin-server,kdc-ldap} ldap-utils slapd apparmor-utils
- name: Silence AppArmor
run: sudo aa-complain $(which slapd)
- name: Setup
Expand Down
5 changes: 3 additions & 2 deletions external/systemd.m4
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ AC_DEFUN([AM_CHECK_SYSTEMD],
[SYSTEMD_DAEMON],
[$daemon_lib_name],
[AC_DEFINE_UNQUOTED([HAVE_SYSTEMD_DAEMON], 1,
[Build with $daemon_lib_name support])],
[Build with $daemon_lib_name support])

AC_MSG_NOTICE([Will enable systemd socket activation])],
[AC_MSG_NOTICE([Build without $daemon_lib_name support])])],
[AC_MSG_NOTICE([Build without $daemon_lib_name support])])

AM_CONDITIONAL([HAVE_SYSTEMD_DAEMON], [test x"$daemon_lib_name" != x])
AC_MSG_NOTICE([Will enable systemd socket activation])
])
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