[gdm/wip/laney/systemd-user: 97/97] Add systemd units



commit aa7933f8682a6a1ee510b28db04c1367dda73f89
Author: Iain Lane <iainl gnome org>
Date:   Wed Jul 4 16:57:26 2018 +0100

    Add systemd units
    
    This is so we can start g-s-d and Shell up under systemd --user for GDM

 configure.ac                    | 16 ++++++++++++++++
 data/Makefile.am                |  4 ++++
 data/gnome-login-wayland.target |  8 ++++++++
 data/gnome-login.target         |  8 ++++++++
 4 files changed, 36 insertions(+)
---
diff --git a/configure.ac b/configure.ac
index 12d9331c..b4a011bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -254,10 +254,17 @@ AC_ARG_WITH(tcp-wrappers,
                            [Use TCP Wrappers @<:@default=auto@:>@]),,
             with_tcp_wrappers=auto)
 
+
 AC_ARG_WITH([udevdir],
             AS_HELP_STRING([--with-udevdir=DIR],
                            [Directory for udev files]),
                 [with_udevdir=$withval], [with_udevdir=$($PKG_CONFIG --variable=udevdir udev)])
+
+AC_ARG_WITH([systemduserunitdir],
+            AS_HELP_STRING([--with-systemduserunitdir=DIR],
+                           [Directory for systemd user service files]),
+                [with_systemduserunitdir=$withval], [with_systemduserunitdir=$($PKG_CONFIG 
--variable=systemduserunitdir systemd)])
+
 AC_ARG_WITH([systemdsystemunitdir],
             AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
                            [Directory for systemd service files]),
@@ -870,11 +877,19 @@ AC_PATH_PROG(SYSTEMD_X_SERVER, systemd-multi-seat-x, [/lib/systemd/systemd-multi
 AC_SUBST(SYSTEMD_X_SERVER)
 AC_DEFINE_UNQUOTED(SYSTEMD_X_SERVER,"$SYSTEMD_X_SERVER",[Path to systemd X server wrapper])
 
+
 if test "x$with_udevdir" != xno; then
         AC_SUBST(UDEV_DIR, [$with_udevdir])
 fi
 AM_CONDITIONAL(INSTALL_UDEV_RULES, test x$with_udevdir != xno)
 
+if test "x$with_systemduserunitdir" = xno; then
+        AC_MSG_ERROR([systemd --user support is required])
+else
+        AC_SUBST(SYSTEMD_USER_UNIT_DIR, [$with_systemduserunitdir])
+fi
+
+
 if test "x$with_systemdsystemunitdir" != xno; then
         AC_SUBST(SYSTEMD_SYSTEM_UNIT_DIR, [$with_systemdsystemunitdir])
 fi
@@ -1526,6 +1541,7 @@ echo \
         SELinux support:          ${use_selinux}
         systemd unit dir:         ${with_systemdsystemunitdir}
         udev dir:                 ${with_udevdir}
+        systemd user unit dir:    ${with_systemduserunitdir}
         plymouth support:         ${use_plymouth}
         wayland support:          ${enable_wayland_support}
         Build with RBAC:          ${msg_rbac_shutdown}
diff --git a/data/Makefile.am b/data/Makefile.am
index 162074f1..2684b687 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -217,6 +217,10 @@ systemdsystemunit_DATA=$(systemdsystemunit)
 systemdsystemunitdir=$(SYSTEMD_SYSTEM_UNIT_DIR)
 endif
 
+systemduserunit = gnome-login.target gnome-login-wayland.target
+systemduserunit_DATA=$(systemduserunit)
+systemduserunitdir=$(SYSTEMD_USER_UNIT_DIR)
+
 Xsession_files =
 if ENABLE_GDM_XSESSION
 
diff --git a/data/gnome-login-wayland.target b/data/gnome-login-wayland.target
new file mode 100644
index 00000000..d4d4e57f
--- /dev/null
+++ b/data/gnome-login-wayland.target
@@ -0,0 +1,8 @@
+[Unit]
+Description=User systemd services for the GDM graphical session (wayland)
+Requires=graphical-session-pre.target
+# start/tear down graphical session target along with our session
+BindsTo=graphical-session.target
+# session leader -- if this dies, die along with it
+BindsTo=gnome-session@gnome-login.service
+Wants=gnome-shell-wayland.target gnome-settings-daemon-gdm-wayland.target
diff --git a/data/gnome-login.target b/data/gnome-login.target
new file mode 100644
index 00000000..36ff39d9
--- /dev/null
+++ b/data/gnome-login.target
@@ -0,0 +1,8 @@
+[Unit]
+Description=User systemd services for the GDM graphical session (x11)
+Requires=graphical-session-pre.target
+# start/tear down graphical session target along with our session
+BindsTo=graphical-session.target
+# session leader -- if this dies, die along with it
+BindsTo=gnome-session@gnome-login.service
+Wants=gnome-shell-x11.target gnome-settings-daemon-gdm-x11.target


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