Re: [PATCH v2 1/9] Check at runtime whether to start ModemManager
- From: Dan Williams <dcbw redhat com>
- To: Tony Espy <espy canonical com>, networkmanager-list gnome org
- Cc: Didier Raboud <odyx debian org>
- Subject: Re: [PATCH v2 1/9] Check at runtime whether to start ModemManager
- Date: Mon, 13 Jun 2016 10:54:07 -0500
On Fri, 2016-06-10 at 17:56 -0400, Tony Espy wrote:
From: Didier Raboud <odyx debian org>
This makes NetworkManager use runtime detection to manage the
ModemManager lifecycle when not run by systemd. Under systemd, we
expect
the ModemManager service to be started by systemd, under non-systemd,
we
use the dbus activation feature to start ModemManager.
Closes: #770871
Feature seems OK, but patch needs some work...
Gbp-Pq: Name Check-at-runtime-whether-to-start-ModemManager.patch
---
src/devices/wwan/nm-modem-manager.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/src/devices/wwan/nm-modem-manager.c
b/src/devices/wwan/nm-modem-manager.c
index e26321b..9e9bc13 100644
--- a/src/devices/wwan/nm-modem-manager.c
+++ b/src/devices/wwan/nm-modem-manager.c
@@ -25,6 +25,7 @@
#include <string.h>
#include <libmm-glib.h>
+#include <systemd/sd-daemon.h>
This requires some configure magic to figure out whether or not we
have libsystemd-daemon, so it would require PKG_CHECK_MODULES in
configure.ac.
For ease of coding, if we don't have libsystemd-daemon, the patch
should probably fake sd_booted() to return false, then we can
unconditionally call sd_booted() in the code. The
AC_DEFINE(HAVE_SYSTEMD...) stuff would get converted into checks for
libsystemd-daemon kinda like the systemd-journal checking.
Dan
#include "nm-modem-manager.h"
#include "nm-dbus-compat.h"
@@ -199,10 +200,9 @@ modem_manager_name_owner_changed (MMManager
*modem_manager,
if (!name_owner) {
nm_log_info (LOGD_MB, "ModemManager disappeared from
bus");
-#if !HAVE_SYSTEMD
/* If not managed by systemd, schedule relaunch */
- schedule_modem_manager_relaunch (self, 0);
-#endif
+ if (!sd_booted())
+ schedule_modem_manager_relaunch (self, 0);
return;
}
@@ -223,8 +223,6 @@ modem_manager_name_owner_changed (MMManager
*modem_manager,
*/
}
-#if !HAVE_SYSTEMD
-
static void
modem_manager_poke_cb (GDBusConnection *connection,
GAsyncResult *res,
@@ -273,8 +271,6 @@ modem_manager_poke (NMModemManager *self)
g_object_ref (self)); /* user_data
*/
}
-#endif /* HAVE_SYSTEMD */
-
static void
modem_manager_check_name_owner (NMModemManager *self)
{
@@ -288,10 +284,9 @@ modem_manager_check_name_owner (NMModemManager
*self)
return;
}
-#if !HAVE_SYSTEMD
/* If the lifecycle is not managed by systemd, poke */
- modem_manager_poke (self);
-#endif
+ if (!sd_booted())
+ modem_manager_poke (self);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]