[gnome-user-share] data: Add a way for gnome-user-share to be started via user systemd



commit d6b6858f39afbf2e9dbd1cb04986d2260f418f11
Author: Bastien Nocera <hadess hadess net>
Date:   Thu May 12 00:11:12 2016 +0200

    data: Add a way for gnome-user-share to be started via user systemd
    
    This will allow better tracking of whether gnome-user-share-webdav 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=766331

 Makefile.am                             |    5 ++++-
 configure.ac                            |   10 ++++++++++
 data/Makefile.am                        |   13 ++++++++++++-
 data/gnome-user-share-webdav.service.in |    8 ++++++++
 4 files changed, 34 insertions(+), 2 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 6fe6fdd..de7c75f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,7 +12,10 @@ DISTCLEANFILES =             \
        intltool-merge          \
        intltool-update
 
-DISTCHECK_CONFIGURE_FLAGS = --disable-schemas-install 
--with-nautilusdir='$${libdir}/nautilus/extensions-2.0-distcheck'
+AM_DISTCHECK_CONFIGURE_FLAGS = \
+       --disable-schemas-install                                               \
+       --with-nautilusdir='$${libdir}/nautilus/extensions-2.0-distcheck'       \
+       --with-systemduserunitdir='$${libdir}/systemd/user-distcheck'
 
 # Build ChangeLog from GIT history
 ChangeLog:
diff --git a/configure.ac b/configure.ac
index bb189a6..57b3d52 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,6 +98,16 @@ AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],"$GETTEXT_PACKAGE", [The gettext package])
 AM_GLIB_GNU_GETTEXT
 
 dnl ==========================================================================
+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 ==========================================================================
 dnl Check for SELinux
 
 AC_CHECK_LIB(selinux, is_selinux_enabled, [ SELINUX_LIBS=-lselinux
diff --git a/data/Makefile.am b/data/Makefile.am
index e59cad1..8b89428 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -12,15 +12,26 @@ gsettings_DATA = $(gsettings_in_files:.xml.in=.xml)
 @INTLTOOL_XML_NOMERGE_RULE@
 @GSETTINGS_RULES@
 
+systemdservicedir = $(systemduserunitdir)
+systemdservice_in_files = gnome-user-share-webdav.service.in
+systemdservice_DATA = gnome-user-share-webdav.service
+
+$(systemdservice_DATA): gnome-user-share-webdav.service.in Makefile
+       $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+
 convertdir = $(datadir)/GConf/gsettings
 convert_DATA = gnome-user-share.convert
 
 EXTRA_DIST = $(app_DATA)  \
        $(gsettings_in_files) \
        $(convert_DATA) \
+       $(systemdservice_in_files) \
        gnome-user-share-webdav.desktop.in.in
 
-CLEANFILES = $(applications_DATA) $(autostart_DATA) $(gsettings_DATA)
+CLEANFILES = $(applications_DATA) \
+       $(autostart_DATA) \
+       $(gsettings_DATA) \
+       $(systemdservice_DATA)
 
 DISTCLEANFILES = $(gsettings_DATA)
 
diff --git a/data/gnome-user-share-webdav.service.in b/data/gnome-user-share-webdav.service.in
new file mode 100644
index 0000000..333ba5d
--- /dev/null
+++ b/data/gnome-user-share-webdav.service.in
@@ -0,0 +1,8 @@
+[Unit]
+Description=gnome-user-share WebDAV server
+
+[Service]
+Type=dbus
+BusName=org.gnome.user-share.webdav
+ExecStart=@libexecdir@/gnome-user-share-webdav
+Restart=on-failure


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]