summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2015-02-09 01:08:29 +0100
committerMichael Biebl <biebl@debian.org>2015-02-09 01:40:59 +0100
commit7dd6a1d428a96c57657cabebb8bdfa87e48f4309 (patch)
treea04f4c7d705d21d3d1a59b2daeacaf2ae2699fe4
parent12c62684cc77f7af0f11eaeabcc07004210d68d4 (diff)
Detect at runtime whether to start ModemManager
When not running under systemd, start ModemManager via dbus activation. Closes: #770871
-rw-r--r--debian/patches/0009-Check-at-runtime-whether-to-start-ModemManager.patch70
-rw-r--r--debian/patches/series1
2 files changed, 71 insertions, 0 deletions
diff --git a/debian/patches/0009-Check-at-runtime-whether-to-start-ModemManager.patch b/debian/patches/0009-Check-at-runtime-whether-to-start-ModemManager.patch
new file mode 100644
index 000000000..2b77012ed
--- /dev/null
+++ b/debian/patches/0009-Check-at-runtime-whether-to-start-ModemManager.patch
@@ -0,0 +1,70 @@
+From: Didier Raboud <odyx@debian.org>
+Date: Mon, 2 Feb 2015 16:06:32 +0100
+Subject: Check at runtime whether to start ModemManager
+
+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
+---
+ 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 f0e5692..b8ecba1 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>
+
+ #include "nm-modem-manager.h"
+ #include "nm-logging.h"
+@@ -202,10 +203,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;
+ }
+@@ -226,8 +226,6 @@ modem_manager_name_owner_changed (MMManager *modem_manager,
+ */
+ }
+
+-#if !HAVE_SYSTEMD
+-
+ static void
+ modem_manager_poke_cb (GDBusConnection *connection,
+ GAsyncResult *res,
+@@ -276,8 +274,6 @@ modem_manager_poke (NMModemManager *self)
+ g_object_ref (self)); /* user_data */
+ }
+
+-#endif /* HAVE_SYSTEMD */
+-
+ static void
+ modem_manager_check_name_owner (NMModemManager *self)
+ {
+@@ -291,10 +287,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
diff --git a/debian/patches/series b/debian/patches/series
index 5e7d55be9..43e9f5c08 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@
0006-Use-the-correct-path-when-calling-dnssec-trigger-scr.patch
0007-fix-arping-path.patch
0008-Fix-dependencies-in-libnm.pc.patch
+0009-Check-at-runtime-whether-to-start-ModemManager.patch