]> git.ipfire.org Git - network.git/commitdiff
networkd: Install a dbus service file
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 30 Jan 2023 04:05:07 +0000 (04:05 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 30 Jan 2023 04:05:07 +0000 (04:05 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
configure.ac
src/networkd/org.ipfire.network1.service [new file with mode: 0644]

index 5bb9c4d00d690bddf0d4b347b8ba5c33239bfe76..5cfeefab4a63c4de3ce2354415b89c162982f4bf 100644 (file)
@@ -62,6 +62,7 @@ INSTALL_EXEC_HOOKS =
 UNINSTALL_EXEC_HOOKS =
 noinst_DATA =
 sbin_PROGRAMS =
+dist_dbussystembusdir_DATA =
 
 AM_CPPFLAGS = \
        $(OUR_CPPFLAGS) \
@@ -330,6 +331,9 @@ networkd_LDFLAGS = \
 networkd_LDADD = \
        $(SYSTEMD_LIBS)
 
+dist_dbussystembusdir_DATA += \
+       src/networkd/org.ipfire.network1.service
+
 # ------------------------------------------------------------------------------
 
 util_PROGRAMS = \
index b8207945528fafe1a08b4a5764beecc0e92790b1..8634a396f9ef6489c264259f37dd330d6c5529a4 100644 (file)
@@ -133,6 +133,20 @@ AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-man-pages],
 AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
 
+# ------------------------------------------------------------------------------
+
+AC_ARG_WITH([dbussystembusdir], AS_HELP_STRING([--with-dbussystembusdir=DIR],
+               [path to D-Bus system bus services directory]), [with_dbussystembusdir=${withval}])
+if test -z "${with_dbussystembusdir}"; then
+       AC_MSG_CHECKING([D-Bus system bus services dir])
+       with_dbussystembusdir="$($PKG_CONFIG --variable=system_bus_services_dir dbus-1)"
+       if test -z "${with_dbussystembusdir}"; then
+               AC_MSG_ERROR([D-Bus system bus services directory is required])
+       fi
+       AC_MSG_RESULT([${with_dbussystembusdir}])
+fi
+AC_SUBST(dbussystembusdir, [${with_dbussystembusdir}])
+
 # ------------------------------------------------------------------------------
 AC_ARG_WITH([systemdsystemunitdir],
        AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
@@ -176,6 +190,7 @@ AC_MSG_RESULT([
 
        prefix:               $prefix
 
+       dbussystembusdir:     ${dbussystembusdir}
        systemdsystemunitdir: $systemdsystemunitdir
        udevdir:              $udevdir
 
diff --git a/src/networkd/org.ipfire.network1.service b/src/networkd/org.ipfire.network1.service
new file mode 100644 (file)
index 0000000..fdeda66
--- /dev/null
@@ -0,0 +1,5 @@
+[D-BUS Service]
+Name=org.ipfire.network1
+Exec=/bin/false
+User=root
+SystemdService=dbus-org.ipfire.network1.service