summaryrefslogtreecommitdiffstats
path: root/src/sbus/sssd_dbus.h
diff options
context:
space:
mode:
authorFabiano Fidêncio <fidencio@redhat.com>2016-12-02 18:10:47 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2017-01-23 18:46:37 +0100
commit7622d9d97eb6747a9f3406633281f2492f8f4a0a (patch)
tree6a798c3f4d34fb86871be3b87f80339456dcd9bd /src/sbus/sssd_dbus.h
parentb46c4c0d3e364636af1b42683cd3229ffa0b77cb (diff)
downloadsssd-7622d9d97eb6747a9f3406633281f2492f8f4a0a.tar.gz
sssd-7622d9d97eb6747a9f3406633281f2492f8f4a0a.tar.xz
sssd-7622d9d97eb6747a9f3406633281f2492f8f4a0a.zip
SBUS: Add destructor data to sbus_connection
This additions has a very specific reason: unregister a service when it's shutdown. So far, we never had to do this kind of operation because the services were started during SSSD's startup when finished when SSSD finished. Now, with the socket-activation in place the game will be a little bit different as the services will have an idle timeout and will be able shut themselves down. In order to do it properly the monitor will need to "unregister" the service and there's no way to do that without adding this destructor data to the sbus_connection structure and introducing a new function to access it from the monitor (where we're going to set the destructor function to the sbus_connection for the socket-activated services). So far it's not being used anywhere as every function taking it as parameter is just receiving NULL, but it will be used in the follow up commits, by the monitor. Related: https://fedorahosted.org/sssd/ticket/3245 Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Pavel Březina <pbrezina@redhat.com> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/sbus/sssd_dbus.h')
-rw-r--r--src/sbus/sssd_dbus.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/sbus/sssd_dbus.h b/src/sbus/sssd_dbus.h
index 0cce8b963..5a66f09d5 100644
--- a/src/sbus/sssd_dbus.h
+++ b/src/sbus/sssd_dbus.h
@@ -74,12 +74,6 @@ struct sbus_request;
typedef int (*sbus_msg_handler_fn)(struct sbus_request *dbus_req,
void *handler_data);
-/*
- * sbus_conn_destructor_fn
- * Function to be called when a connection is finalized
- */
-typedef int (*sbus_conn_destructor_fn)(void *);
-
typedef void (*sbus_conn_reconn_callback_fn)(struct sbus_connection *, int, void *);
/*
@@ -141,7 +135,9 @@ int sbus_new_server(TALLOC_CTX *mem_ctx,
uid_t uid, gid_t gid,
bool use_symlink,
struct sbus_connection **server,
- sbus_server_conn_init_fn init_fn, void *init_pvt_data);
+ sbus_server_conn_init_fn init_fn,
+ void *init_pvt_data,
+ void *client_destructor_data);
/* Connection Functions */
@@ -175,6 +171,7 @@ int sbus_init_connection(TALLOC_CTX *ctx,
DBusConnection *dbus_conn,
int connection_type,
time_t *last_request_time,
+ void *destructor_data,
struct sbus_connection **_conn);
DBusConnection *sbus_get_connection(struct sbus_connection *conn);
@@ -450,4 +447,10 @@ sbus_signal_listen(struct sbus_connection *conn,
sbus_incoming_signal_fn handler_fn,
void *handler_data);
+/* This function returns the destructor data passed when in starting
+ * a new dbus server/connection. Its use, for now, must be restricted
+ * to {dbus,socket}-activated services in order to proper shut them
+ * down, unregistering them in the monitor. */
+void *sbus_connection_get_destructor_data(struct sbus_connection *conn);
+
#endif /* _SSSD_DBUS_H_*/