summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-09-25 13:23:42 +0200
committerAleksander Morgado <aleksander@aleksander.es>2019-10-30 10:53:44 +0100
commit142aab959a3e0e9900111dde5fb5bcdece7b0a8f (patch)
treea3b90b1b0d48576e08c346a3513e1b61184dc0ca
parente68f08acc332967946e0454f0e7cc0a6b79a8df4 (diff)
systemd: always start MM after polkit service if enabling policy
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/113 (cherry picked from commit 55c3f7d3f693029ee759bd8f77573eef3ae5204b)
-rw-r--r--configure.ac4
-rw-r--r--data/Makefile.am3
-rw-r--r--data/ModemManager.service.in2
3 files changed, 8 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index e45ced69..7c4df8c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -288,6 +288,7 @@ elif test "x$with_polkit" = "xyes"; then
with_polkit=strict
fi
+MM_POLKIT_SERVICE=""
if test "x$with_polkit" != "xno"; then
if test "x$have_polkit" = "xno"; then
AC_MSG_ERROR(PolicyKit development headers are required)
@@ -296,9 +297,11 @@ if test "x$with_polkit" != "xno"; then
case "x$with_polkit" in
"xpermissive")
MM_DEFAULT_USER_POLICY="yes"
+ MM_POLKIT_SERVICE="polkit.service"
;;
"xstrict")
MM_DEFAULT_USER_POLICY="auth_self_keep"
+ MM_POLKIT_SERVICE="polkit.service"
;;
*)
AC_MSG_ERROR([Wrong value for --with-polkit: $with_polkit])
@@ -311,6 +314,7 @@ if test "x$with_polkit" != "xno"; then
AC_SUBST(MM_DEFAULT_USER_POLICY)
fi
+AC_SUBST(MM_POLKIT_SERVICE)
AM_CONDITIONAL(WITH_POLKIT, [test "x$with_polkit" != "xno"])
dnl-----------------------------------------------------------------------------
diff --git a/data/Makefile.am b/data/Makefile.am
index ee05bdf6..447cb3d0 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -5,7 +5,8 @@ edit = @sed \
-e 's|@sbindir[@]|$(sbindir)|g' \
-e 's|@sysconfdir[@]|$(sysconfdir)|g' \
-e 's|@localstatedir[@]|$(localstatedir)|g' \
- -e 's|@libexecdir[@]|$(libexecdir)|g'
+ -e 's|@libexecdir[@]|$(libexecdir)|g' \
+ -e 's|@MM_POLKIT_SERVICE[@]|$(MM_POLKIT_SERVICE)|g'
# DBus Service file
diff --git a/data/ModemManager.service.in b/data/ModemManager.service.in
index 420d22b1..23bf8091 100644
--- a/data/ModemManager.service.in
+++ b/data/ModemManager.service.in
@@ -1,5 +1,7 @@
[Unit]
Description=Modem Manager
+After=@MM_POLKIT_SERVICE@
+Requires=@MM_POLKIT_SERVICE@
[Service]
Type=dbus