diff options
author | Michael Biebl <biebl@debian.org> | 2015-02-09 02:15:18 +0100 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2015-02-09 02:17:20 +0100 |
commit | 2111e80757fc0f7865154b97e2d2549f07f2fa04 (patch) | |
tree | 3f7dbb20d0fc46d3942722ab0d4fa84075240fb0 | |
parent | 85043427c51e243ab0af71e1d4d280dc236258e7 (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/0017-Check-at-runtime-whether-to-start-ModemManager.patch | 71 | ||||
-rw-r--r-- | debian/patches/series | 1 |
2 files changed, 72 insertions, 0 deletions
diff --git a/debian/patches/0017-Check-at-runtime-whether-to-start-ModemManager.patch b/debian/patches/0017-Check-at-runtime-whether-to-start-ModemManager.patch new file mode 100644 index 000000000..6c0942b96 --- /dev/null +++ b/debian/patches/0017-Check-at-runtime-whether-to-start-ModemManager.patch @@ -0,0 +1,71 @@ +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 | 16 ++++++---------- + 1 file changed, 6 insertions(+), 10 deletions(-) + +diff --git a/src/devices/wwan/nm-modem-manager.c b/src/devices/wwan/nm-modem-manager.c +index c481170..589fb5c 100644 +--- a/src/devices/wwan/nm-modem-manager.c ++++ b/src/devices/wwan/nm-modem-manager.c +@@ -21,6 +21,8 @@ + */ + + #include <string.h> ++#include <systemd/sd-daemon.h> ++ + #include "config.h" + #include "nm-modem-manager.h" + #include "nm-logging.h" +@@ -466,10 +468,9 @@ modem_manager_1_name_owner_changed (MMManager *modem_manager_1, + 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_1_relaunch (self, 0); +-#endif ++ if (!sd_booted()) ++ schedule_modem_manager_1_relaunch (self, 0); + + return; + } +@@ -490,8 +491,6 @@ modem_manager_1_name_owner_changed (MMManager *modem_manager_1, + */ + } + +-#if !HAVE_SYSTEMD +- + static void + modem_manager_1_poke_cb (GDBusConnection *connection, + GAsyncResult *res, +@@ -540,8 +539,6 @@ modem_manager_1_poke (NMModemManager *self) + g_object_ref (self)); /* user_data */ + } + +-#endif /* HAVE_SYSTEMD */ +- + static void + modem_manager_1_check_name_owner (NMModemManager *self) + { +@@ -555,10 +552,9 @@ modem_manager_1_check_name_owner (NMModemManager *self) + return; + } + +-#if !HAVE_SYSTEMD + /* If the lifecycle is not managed by systemd, poke */ +- modem_manager_1_poke (self); +-#endif ++ if (!sd_booted()) ++ modem_manager_1_poke (self); + } + + static void diff --git a/debian/patches/series b/debian/patches/series index 123636201..873c3c1eb 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -14,3 +14,4 @@ 0014-log-DHCLIENT-exit-status-better.patch 0015-core-don-t-override-external-route-metrics.patch 0016-core-tell-systemd-to-restart-NetworkManager.service-.patch +0017-Check-at-runtime-whether-to-start-ModemManager.patch |