[gdm] systemd: install a gdm.service unit file by default
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm] systemd: install a gdm.service unit file by default
- Date: Tue, 7 Aug 2012 03:25:01 +0000 (UTC)
commit a5cca5e8c228b272a985c28411311002ba092685
Author: Lennart Poettering <lennart poettering net>
Date: Mon Aug 6 20:01:40 2012 +0200
systemd: install a gdm.service unit file by default
https://fedoraproject.org/wiki/Features/DisplayManagerRework
Some changes by Ray Strode.
https://bugzilla.gnome.org/show_bug.cgi?id=681339
configure.ac | 10 ++++++++++
data/.gitignore | 1 +
data/Makefile.am | 32 +++++++++++++++++++++++++++++++-
data/gdm.service.in | 13 +++++++++++++
4 files changed, 55 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 26f7826..19033f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -276,6 +276,10 @@ AC_ARG_WITH(systemd,
AS_HELP_STRING([--with-systemd],
[Add systemd support @<:@default=auto@:>@]),
[with_systemd=$withval], [with_systemd=auto])
+AC_ARG_WITH([systemdsystemunitdir],
+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
+ [Directory for systemd service files]),
+ [with_systemdsystemunitdir=$withval], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
AC_ARG_WITH(plymouth,
AS_HELP_STRING([--with-plymouth],
[Add plymouth support @<:@default=auto@:>@]),
@@ -942,6 +946,11 @@ 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_systemdsystemunitdir" != xno; then
+ AC_SUBST(SYSTEMD_SYSTEM_UNIT_DIR, [$with_systemdsystemunitdir])
+fi
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno -a "x$use_systemd" = "xyes" ])
+
dnl ---------------------------------------------------------------------------
dnl - Check for plymouth support
dnl ---------------------------------------------------------------------------
@@ -1569,6 +1578,7 @@ echo \
XDMCP support: ${XDMCP_SUPPORT}
ConsoleKit support: ${use_console_kit}
systemd support: ${use_systemd}
+ systemd unit dir: ${with_systemdsystemunitdir}
plymouth support: ${use_plymouth}
UPower support: ${have_upower}
Build with RBAC: ${msg_rbac_shutdown}
diff --git a/data/.gitignore b/data/.gitignore
new file mode 100644
index 0000000..d9c62cb
--- /dev/null
+++ b/data/.gitignore
@@ -0,0 +1 @@
+/gdm.service
diff --git a/data/Makefile.am b/data/Makefile.am
index ffbc768..6a44b40 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -150,6 +150,22 @@ MAINTAINERCLEANFILES = \
*~ \
Makefile.in
+systemdsystemunit =
+
+if HAVE_SYSTEMD
+
+gdm.service: $(srcdir)/gdm.service.in
+ $(AM_V_GEN)sed \
+ -e 's,[ ]sbindir[@],$(sbindir),g' \
+ -e 's,[ ]GDM_INITIAL_VT[@],$(GDM_INITIAL_VT),g' \
+ < $< > $@
+systemdsystemunit += gdm.service
+CLEANFILES += gdm.service
+
+endif
+
+EXTRA_DIST += gdm.service.in
+
uninstall-hook:
rm -f \
$(DESTDIR)$(GDM_CUSTOM_CONF) \
@@ -173,7 +189,13 @@ uninstall-hook:
$(DESTDIR)$(sysconfdir)/dconf/db \
$(DESTDIR)$(sysconfdir)/dconf
-install-data-hook: gdm.conf-custom Xsession Init PostSession PreSession 00-upstream-settings 00-upstream-settings-locks
+ if test -n "$(systemdsystemunit)"; then \
+ rm -f $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR)/$(systemdsystemunit); \
+ rmdir $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR) || : ; \
+ fi
+
+
+install-data-hook: gdm.conf-custom Xsession Init PostSession PreSession 00-upstream-settings 00-upstream-settings-locks $(systemdsystemunit)
if test '!' -d $(DESTDIR)$(gdmconfdir); then \
$(mkinstalldirs) $(DESTDIR)$(gdmconfdir); \
chmod 755 $(DESTDIR)$(gdmconfdir); \
@@ -253,6 +275,13 @@ install-data-hook: gdm.conf-custom Xsession Init PostSession PreSession 00-upstr
chown root:gdm $(DESTDIR)$(xauthdir) || : ; \
fi
+ if test -n "$(systemdsystemunit)" -a '!' -d $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR); then \
+ $(mkinstalldirs) $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR); \
+ chmod 0755 $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR); \
+ chown root:root $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR) || : ; \
+ $(INSTALL_DATA) $(builddir)/$(systemdsystemunit) $(DESTDIR)$(SYSTEMD_SYSTEM_UNIT_DIR)/$(systemdsystemunit); \
+ fi
+
if test '!' -d $(DESTDIR)$(screenshotdir); then \
$(mkinstalldirs) $(DESTDIR)$(screenshotdir); \
chmod 0755 $(DESTDIR)$(screenshotdir); \
@@ -311,3 +340,4 @@ install-data-hook: gdm.conf-custom Xsession Init PostSession PreSession 00-upstr
$(INSTALL_DATA) $(srcdir)/00-upstream-settings $(DESTDIR)$(sysconfdir)/dconf/db/gdm.d
$(INSTALL_DATA) $(srcdir)/00-upstream-settings-locks $(DESTDIR)$(sysconfdir)/dconf/db/gdm.d/locks
test -z "$(DESTDIR)" && dconf update || :
+
diff --git a/data/gdm.service.in b/data/gdm.service.in
new file mode 100644
index 0000000..c15a415
--- /dev/null
+++ b/data/gdm.service.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=GNOME Display Manager
+Conflicts=getty tty@GDM_INITIAL_VT service plymouth-quit.service
+After=systemd-user-sessions.service getty tty@GDM_INITIAL_VT service plymouth-quit.service
+
+[Service]
+ExecStart= sbindir@/gdm
+Restart=always
+IgnoreSIGPIPE=no
+BusName=org.gnome.DisplayManager
+
+[Install]
+Alias=display-manager.service
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]