[rygel/rygel-0-30] data: Add a way for Rygel to be started via user systemd
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rygel/rygel-0-30] data: Add a way for Rygel to be started via user systemd
- Date: Sat, 21 May 2016 10:26:19 +0000 (UTC)
commit 26c8d2e19f8ac304b24218e594ca45fa07fc83df
Author: Bastien Nocera <hadess hadess net>
Date: Wed May 11 23:37:41 2016 +0200
data: Add a way for Rygel to be started via user systemd
This will allow better tracking of whether rygel is running, ensuring
that even if the manager to enable/disable its startup
(gnome-settings-daemon) crashes and needs to restart, its status is
still available by querying the user systemd.
https://bugzilla.gnome.org/show_bug.cgi?id=766332
Makefile.am | 2 +-
configure.ac | 9 +++++++++
data/Makefile.am | 14 ++++++++++++--
data/rygel.service.in | 8 ++++++++
4 files changed, 30 insertions(+), 3 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 3f6a082..51bc583 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,7 +12,7 @@ EXTRA_DIST = rygel-core-2.6.pc.in rygel-renderer-2.6.pc.in \
rygel-server-2.6.pc.in .version \
build-aux/git-version-gen
-DISTCHECK_CONFIGURE_FLAGS =
+AM_DISTCHECK_CONFIGURE_FLAGS = --with-systemduserunitdir='$${libdir}/systemd/user-distcheck'
# Extra clean files so that maintainer-clean removes *everything*
MAINTAINERCLEANFILES = aclocal.m4 compile config.guess config.sub configure depcomp install-sh ltmain.sh
Makefile.in missing config.h.in
diff --git a/configure.ac b/configure.ac
index 6f8bc21..db85a59 100644
--- a/configure.ac
+++ b/configure.ac
@@ -403,6 +403,15 @@ AS_IF([test "x$enable_coverage" != "xno"],
]
)
+dnl systemd user unit directory
+AC_ARG_WITH([systemduserunitdir],
+ AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd user service files]),
+ [],
+ [with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)])
+if test x$with_systemduserunitdir != xno; then
+ AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
+fi
+
dnl Check additional requirements for MediaExport plugins
if test "x$enable_media_export_plugin" = "xyes";
then
diff --git a/data/Makefile.am b/data/Makefile.am
index b687a99..4e4f54d 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -17,6 +17,15 @@ dbusservice_DATA = $(dbusservice_in_files:.service.in=.service)
$(dbusservice_DATA): $(dbusservice_in_files) Makefile
@sed -e "s|\ bindir\@|$(bindir)|" $< > $@
+# systemd service file
+systemdservicedir = $(systemduserunitdir)
+systemdservice_in_files = rygel.service.in
+systemdservice_DATA = rygel.service
+
+# Rule to make the systemd service file with bindir expanded
+$(systemdservice_DATA): rygel.service.in Makefile
+ $(AM_V_GEN) $(SED) -e "s|\ bindir\@|$(bindir)|" $< > $@
+
# Rule to create the .desktop files
desktop_in_files = $(srcdir)/rygel.desktop.in $(srcdir)/rygel-preferences.desktop.in
desktop_DATA = rygel.desktop rygel-preferences.desktop
@@ -39,10 +48,11 @@ preset_DATA = $(srcdir)/presets/avenc_aac.prs \
$(srcdir)/presets/GstTwoLame.prs \
$(srcdir)/presets/GstX264Enc.prs
-CLEANFILES = $(dbusservice_DATA) $(desktop_DATA)
+CLEANFILES = $(dbusservice_DATA) $(desktop_DATA) $(systemdservice_DATA)
EXTRA_DIST = $(dbusservice_in_files) \
$(desktop_in_files) \
rygel.desktop.in.in rygel-preferences.desktop.in.in \
$(sysconf_DATA) \
$(pixmaps_DATA) \
- $(preset_DATA)
+ $(preset_DATA) \
+ $(systemdservice_in_files)
diff --git a/data/rygel.service.in b/data/rygel.service.in
new file mode 100644
index 0000000..77cc9d7
--- /dev/null
+++ b/data/rygel.service.in
@@ -0,0 +1,8 @@
+[Unit]
+Description=Rygel DLNA/UPnP server
+
+[Service]
+Type=dbus
+BusName=org.gnome.Rygel1
+ExecStart= bindir@/rygel
+Restart=on-failure
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]