Skip to content

Commit

Permalink
Get rid of '--dbus-activated'.
Browse files Browse the repository at this point in the history
Code makes no difference handling '--socket-activated' and
'--dbus-activated', it only makes things more obscure.
Moreover, on a systemd enabled system, dbus activation actually
starts systemd service anyway, so there is really no big difference.
  • Loading branch information
alexey-tikhonov committed Aug 14, 2023
1 parent a563cb9 commit 2b60fe0
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ deskprofilepath = $(sss_statedir)/deskprofile

if HAVE_SYSTEMD_UNIT
ifp_dbus_exec_comment = \# If system is configured to use systemd ifp service ("SystemdService=") then "Exec=" and "User=" options are not used
ifp_dbus_exec_cmd = $(sssdlibexecdir)/sssd_ifp --dbus-activated
ifp_dbus_exec_cmd = $(sssdlibexecdir)/sssd_ifp --socket-activated
ifp_systemdservice = SystemdService=sssd-ifp.service
# SSSD requires a configuration file (either /etc/sssd/sssd.conf,
# or some snippet under /etc/sssd/sssd.conf.d/) to be present.
Expand Down
1 change: 0 additions & 1 deletion src/responder/common/responder.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ struct resp_ctx {

bool shutting_down;
bool socket_activated;
bool dbus_activated;
bool cache_first;
bool enumeration_warn_logged;
};
Expand Down
10 changes: 3 additions & 7 deletions src/responder/common/responder_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1316,7 +1316,6 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
rctx->confdb_service_path = confdb_service_path;
rctx->shutting_down = false;
rctx->socket_activated = is_socket_activated();
rctx->dbus_activated = is_dbus_activated();

talloc_set_destructor((TALLOC_CTX*)rctx, sss_responder_ctx_destructor);

Expand All @@ -1336,7 +1335,7 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
rctx->client_idle_timeout = 10;
}

if (rctx->socket_activated || rctx->dbus_activated) {
if (rctx->socket_activated) {
ret = responder_setup_idle_timeout_config(rctx);
if (ret != EOK) {
goto fail;
Expand Down Expand Up @@ -1507,11 +1506,8 @@ int sss_process_init(TALLOC_CTX *mem_ctx,
goto fail;
}

DEBUG(SSSDBG_TRACE_FUNC,
"Responder initialization complete (%s)\n",
rctx->socket_activated ? "socket-activated" :
rctx->dbus_activated ? "dbus-activated" :
"explicitly configured");
DEBUG(SSSDBG_TRACE_FUNC, "Responder initialization complete (%s)\n",
rctx->socket_activated ? "socket-activated" : "explicitly configured");

*responder_ctx = rctx;
return EOK;
Expand Down
2 changes: 1 addition & 1 deletion src/sysv/systemd/sssd-ifp.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ EnvironmentFile=-@environment_file@
Type=dbus
BusName=org.freedesktop.sssd.infopipe
ExecStartPre=-/bin/chown @SSSD_USER@:@SSSD_USER@ @logpath@/sssd_ifp.log
ExecStart=@libexecdir@/sssd/sssd_ifp ${DEBUG_LOGGER} --dbus-activated
ExecStart=@libexecdir@/sssd/sssd_ifp ${DEBUG_LOGGER} --socket-activated
CapabilityBoundingSet= @additional_caps@ CAP_IPC_LOCK CAP_CHOWN CAP_DAC_READ_SEARCH CAP_FOWNER CAP_SETGID CAP_SETUID
Restart=on-failure
User=@SSSD_USER@
Expand Down
2 changes: 1 addition & 1 deletion src/util/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ int server_setup(const char *name, bool is_responder,
sss_strerror(ret), ret);
}

if (!is_socket_activated() && !is_dbus_activated()) {
if (!is_socket_activated()) {
ret = chown_debug_file(NULL, uid, gid);
if (ret != EOK) {
DEBUG(SSSDBG_MINOR_FAILURE,
Expand Down
10 changes: 0 additions & 10 deletions src/util/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "util/sss_utf8.h"

int socket_activated = 0;
int dbus_activated = 0;

static void free_args(char **args)
{
Expand Down Expand Up @@ -1006,15 +1005,6 @@ bool is_socket_activated(void)
#endif
}

bool is_dbus_activated(void)
{
#ifdef HAVE_SYSTEMD
return !!dbus_activated;
#else
return false;
#endif
}

int sss_rand(void)
{
static bool srand_done = false;
Expand Down
8 changes: 1 addition & 7 deletions src/util/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,11 @@
_("The group ID to run the server as"), NULL},

extern int socket_activated;
extern int dbus_activated;

#ifdef HAVE_SYSTEMD
#define SSSD_RESPONDER_OPTS \
{ "socket-activated", 0, POPT_ARG_NONE, &socket_activated, 0, \
_("Informs that the responder has been socket-activated"), NULL }, \
{ "dbus-activated", 0, POPT_ARG_NONE, &dbus_activated, 0, \
_("Informs that the responder has been dbus-activated"), NULL },
_("Informs that the responder has been socket-activated"), NULL },
#else
#define SSSD_RESPONDER_OPTS
#endif
Expand Down Expand Up @@ -420,9 +417,6 @@ bool is_user_or_group_name(const char *sudo_user_value);
/* Returns true if the responder has been socket-activated */
bool is_socket_activated(void);

/* Returns true if the responder has been dbus-activated */
bool is_dbus_activated(void);

/**
* @brief Add two list of strings
*
Expand Down

0 comments on commit 2b60fe0

Please sign in to comment.