[systemd-devel] [PATCH] ModemManager: systemd support

Andrey Borzenkov arvidjaar at gmail.com
Sat Jan 29 12:22:24 PST 2011


Signed-off-by: Andrey Borzenkov <arvidjaar at gmail.com>

---
 .gitignore                              |    2 ++
 Makefile.am                             |   13 ++++++++++---
 ModemManager.service.in                 |    8 ++++++++
 configure.ac                            |   10 ++++++++++
 org.freedesktop.ModemManager.service.in |    1 +
 5 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/.gitignore b/.gitignore
index d8a6a13..d6f2c07 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,3 +47,5 @@ m4/gtk-doc.m4
 m4/intltool.m4
 m4/libtool.m4
 m4/lt*.m4
+
+ModemManager.service
diff --git a/Makefile.am b/Makefile.am
index 4132bc9..7eae53d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -63,7 +63,7 @@ edit = @sed \
 	-e 's|@localstatedir[@]|$(localstatedir)|g' \
 	-e 's|@libexecdir[@]|$(libexecdir)|g'
 
-DISTCHECK_CONFIGURE_FLAGS = --with-udev-base-dir=$dc_install_base --with-tests=yes
+DISTCHECK_CONFIGURE_FLAGS = --with-udev-base-dir=$dc_install_base --with-tests=yes --with-systemdsystemunitdir=
 
 INTLTOOL_FILES = \
 	intltool-extract.in \
@@ -76,7 +76,8 @@ DISTCLEANFILES = \
 	intltool-extract \
 	intltool-merge \
 	intltool-update \
-	po/.intltool-merge-cache
+	po/.intltool-merge-cache \
+	ModemManager.service
 
 EXTRA_DIST = \
 	doc-generator.xsl \
@@ -84,6 +85,12 @@ EXTRA_DIST = \
 	$(dbusactivation_in_files) \
 	$(INTLTOOL_FILES) \
 	$(dbusservice_file_polkit) \
-	$(dbusservice_file_nopolkit)
+	$(dbusservice_file_nopolkit) \
+	ModemManager.service.in
 
 ACLOCAL_AMFLAGS = -I m4
+
+if HAVE_SYSTEMD
+systemdsystemunit_DATA = \
+	ModemManager.service
+endif
diff --git a/ModemManager.service.in b/ModemManager.service.in
new file mode 100644
index 0000000..2844a7a
--- /dev/null
+++ b/ModemManager.service.in
@@ -0,0 +1,8 @@
+[Unit]
+Description=Modem Manager
+After=syslog.target
+
+[Service]
+Type=dbus
+BusName=org.freedesktop.ModemManager
+ExecStart=@sbindir@/modem-manager
diff --git a/configure.ac b/configure.ac
index 4f8b94f..f9c4ecd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -133,6 +133,14 @@ if ! test x"$ac_distver" = x""; then
   AC_DEFINE_UNQUOTED(MM_DIST_VERSION, "$ac_distver", [Define the distribution version string])
 fi
 
+# systemd
+AC_ARG_WITH([systemdsystemunitdir],
+        AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+        [],
+        [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
+
 AC_CONFIG_FILES([
 Makefile
 marshallers/Makefile
@@ -162,4 +170,6 @@ echo Building with PolicyKit support: ${with_polkit}
 echo
 echo Building with Location API support: ${with_location_api}
 echo
+echo Building with systemd support: ${with_systemdsystemunitdir}
+echo
 
diff --git a/org.freedesktop.ModemManager.service.in b/org.freedesktop.ModemManager.service.in
index 2b73cce..80a2daa 100644
--- a/org.freedesktop.ModemManager.service.in
+++ b/org.freedesktop.ModemManager.service.in
@@ -2,3 +2,4 @@
 Name=org.freedesktop.ModemManager
 Exec=@sbindir@/modem-manager
 User=root
+SystemdService=ModemManager.service
-- 
tg: (00b6cce..) upstream/systemd (depends on: master)


More information about the systemd-devel mailing list