From aa6932ca49670d08d0675160caa2c13e0b93f4a3 Mon Sep 17 00:00:00 2001 From: Iain Lane Date: Wed, 4 Jul 2018 16:57:26 +0100 Subject: Add systemd units This is so we can start g-s-d and Shell up under systemd --user for GDM --- configure.ac | 20 ++++++++++++++++++++ data/Makefile.am | 6 ++++++ data/gnome-login-wayland.target | 8 ++++++++ data/gnome-login.target | 8 ++++++++ 4 files changed, 42 insertions(+) create mode 100644 data/gnome-login-wayland.target create mode 100644 data/gnome-login.target diff --git a/configure.ac b/configure.ac index 12d9331c..02389141 100644 --- a/configure.ac +++ b/configure.ac @@ -254,10 +254,21 @@ 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)]) + +# It is correct for this to be in ${prefix}/lib, even on systems where that +# does not match ${libdir}. This is what systemd uses on such platforms. +AC_ARG_WITH([systemduserunitdir], + AS_HELP_STRING([--with-systemduserunitdir=PATH], + [Directory for systemd user units] + [[default=${prefix}/lib/systemd/user]]), + [with_systemduserunitdir="$withval"], + [with_systemduserunitdir='${prefix}/lib/systemd/user']) + AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), @@ -870,11 +881,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 +1545,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..2e4c593a 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -217,6 +217,12 @@ 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) + +EXTRA_DIST += gnome-login.target gnome-login-wayland.target + 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 -- cgit v1.2.1