[vino] server: Add a way for Vino to be started via user systemd



commit 27785a23ca582a0b974b34cb7505b53299bd27ac
Author: Bastien Nocera <hadess hadess net>
Date:   Wed May 11 23:53:13 2016 +0200

    server: Add a way for Vino to be started via user systemd
    
    This will allow better tracking of whether vino 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=766330

 Makefile.am                   |   12 +++++++++++-
 configure.ac                  |   10 ++++++++++
 server/vino-server.service.in |    8 ++++++++
 3 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index c8ff832..155eb49 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,7 +11,8 @@ DISTCHECK_CONFIGURE_FLAGS = \
        --with-zlib \
        --with-jpeg \
        --enable-debug \
-       --enable-compile-warnings=maximum
+       --enable-compile-warnings=maximum \
+       --with-systemduserunitdir='$${libdir}/systemd/user-distcheck'
 
 noinst_LTLIBRARIES = \
        libeggsmclient.la
@@ -236,6 +237,13 @@ nodist_service_DATA = server/org.freedesktop.Telepathy.Client.Vino.service
 server/org.freedesktop.Telepathy.Client.Vino.service: server/org.freedesktop.Telepathy.Client.Vino.service.in
        $(AM_V_GEN)$(SED) -e "s|[@]libexecdir[@]|$(libexecdir)|" $< > $@
 
+systemdservicedir = $(systemduserunitdir)
+systemdservice_in_files = server/vino-server.service.in
+systemdservice_DATA = server/vino-server.service
+
+$(systemdservice_DATA): server/vino-server.service.in Makefile
+       $(AM_V_GEN) $(SED) -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
+
 applicationsdir = $(datadir)/applications/
 applications_in_files = server/vino-server.desktop.in
 nodist_applications_DATA = $(applications_in_files:.desktop.in=.desktop)
@@ -267,6 +275,7 @@ dist-changelog:
 
 dist_noinst_DATA = \
        $(desktop_in_files) \
+       $(systemdservice_in_files) \
        \
        $(gsettings_ENUM_FILES) \
        $(gsettings_SCHEMAS) \
@@ -298,6 +307,7 @@ CLEANFILES = \
        $(nodist_service_DATA) \
        $(marshal_data) \
        $(enum_data) \
+       $(systemdservice_DATA) \
        server/vino-server.desktop \
        server/vino-server.desktop.in
 
diff --git a/configure.ac b/configure.ac
index 0248d55..0999e87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -265,6 +265,16 @@ AS_IF([test "x$have_ipv6" = "xyes"],
     [AC_MSG_ERROR([IPv6 support requested but not found])])])
 AC_MSG_RESULT([$have_ipv6])
 
+dnl systemd user unit directory
+PKG_CHECK_EXISTS (systemd,, AC_MSG_ERROR ([systemd development headers not found]))
+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
+
 # GNOME libraries
 GTK_VERSION=3.0.0
 GLIB_VERSION=2.32.0
diff --git a/server/vino-server.service.in b/server/vino-server.service.in
new file mode 100644
index 0000000..a48b813
--- /dev/null
+++ b/server/vino-server.service.in
@@ -0,0 +1,8 @@
+[Unit]
+Description=Vino VNC server
+
+[Service]
+Type=dbus
+BusName=org.gnome.Vino
+ExecStart=@libexecdir@/vino-server
+Restart=on-failure


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