Make the daemon a system daemon

With this patch, and the D-Bus activation patches posted earlier the
fprintd daemon is started automatically when needed.

We should have a way to exit it nicely when there are no users
anymore as well...
This commit is contained in:
Bastien Nocera
2008-05-13 20:02:08 +01:00
committed by Daniel Drake
parent 822a2e5438
commit 6cbb079619
3 changed files with 7 additions and 11 deletions

View File

@ -223,7 +223,7 @@ int main(int argc, char **argv)
g_print("Launching FprintObject\n");
/* Obtain a connection to the session bus */
fprintd_dbus_conn = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
fprintd_dbus_conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
if (fprintd_dbus_conn == NULL)
g_error("Failed to open connection to bus: %s", error->message);

View File

@ -74,15 +74,13 @@ static void create_manager(void)
{
GError *error = NULL;
connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
connection = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
if (connection == NULL)
g_error("Failed to connect to session bus: %s", error->message);
manager = dbus_g_proxy_new_for_name_owner(connection,
manager = dbus_g_proxy_new_for_name(connection,
"net.reactivated.Fprint", "/net/reactivated/Fprint/Manager",
"net.reactivated.Fprint.Manager", &error);
if (manager == NULL)
g_error("Failed to create proxy: %s", error->message);
"net.reactivated.Fprint.Manager");
}
static DBusGProxy *open_device(void)

View File

@ -100,15 +100,13 @@ static void create_manager(void)
{
GError *error = NULL;
connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
connection = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
if (connection == NULL)
g_error("Failed to connect to session bus: %s", error->message);
manager = dbus_g_proxy_new_for_name_owner(connection,
manager = dbus_g_proxy_new_for_name(connection,
"net.reactivated.Fprint", "/net/reactivated/Fprint/Manager",
"net.reactivated.Fprint.Manager", &error);
if (manager == NULL)
g_error("Failed to create proxy: %s", error->message);
"net.reactivated.Fprint.Manager");
}
static DBusGProxy *open_device(void)