From f7bbbf336f1093b2088f29c26cf412b8d274b0b1 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 21 Jul 2010 16:55:44 +0200 Subject: [PATCH] systemd: install systemd unit files --- Makefile.am | 3 +++ configure.ac | 9 +++++++++ data/.gitignore | 1 + data/Makefile.am | 12 +++++++++++- data/console-kit-daemon.service.in | 15 +++++++++++++++ data/org.freedesktop.ConsoleKit.service.in | 2 ++ 6 files changed, 41 insertions(+), 1 deletions(-) create mode 100644 data/console-kit-daemon.service.in diff --git a/Makefile.am b/Makefile.am index be2efff..9f13e2c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -63,3 +63,6 @@ $(srcdir)/ChangeLog: fi .PHONY: ChangeLog $(srcdir)/ChangeLog + +DISTCHECK_CONFIGURE_FLAGS = \ + --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) diff --git a/configure.ac b/configure.ac index 117d788..17afab8 100644 --- a/configure.ac +++ b/configure.ac @@ -391,6 +391,15 @@ AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) +# systemd + +AC_ARG_WITH([systemdsystemunitdir], + AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), + [], + [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]) +AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) +AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"]) + # Files AC_CONFIG_FILES([ diff --git a/data/.gitignore b/data/.gitignore index b8028aa..ca30d37 100644 --- a/data/.gitignore +++ b/data/.gitignore @@ -2,3 +2,4 @@ Makefile Makefile.in ConsoleKit org.freedesktop.ConsoleKit.service +console-kit-daemon.service diff --git a/data/Makefile.am b/data/Makefile.am index 041b431..8c0490a 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -20,6 +20,15 @@ service_DATA = $(service_in_files:.service.in=.service) $(service_DATA): $(service_in_files) Makefile $(edit) $< >$@ +if HAVE_SYSTEMD +systemdsystemunit_DATA = \ + console-kit-daemon.service + +console-kit-daemon.service: console-kit-daemon.service.in + $(edit) $< >$@ + +endif + edit = sed \ -e 's|@sbindir[@]|$(sbindir)|g' \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ @@ -33,10 +42,11 @@ EXTRA_DIST = \ $(dbusconf_DATA) \ $(seat_DATA) \ $(service_in_files) \ + console-kit-daemon.service.in \ $(NULL) MAINTAINERCLEANFILES = \ *~ \ Makefile.in -CLEANFILES = $(service_DATA) +CLEANFILES = $(service_DATA) console-kit-daemon.service diff --git a/data/console-kit-daemon.service.in b/data/console-kit-daemon.service.in new file mode 100644 index 0000000..a08ec5c --- /dev/null +++ b/data/console-kit-daemon.service.in @@ -0,0 +1,15 @@ +[Unit] +Description=Console Manager +After=syslog.target + +[Service] +Type=dbus +BusName=org.freedesktop.ConsoleKit +ExecStart=@sbindir@/console-kit-daemon --no-daemon + +[Install] +# We pull this in by graphical.target instead of waiting for the bus +# activation, to speed things up a little: gdm uses this anyway so it is nice +# if it is already around when gdm wants to use it and doesn't have to wait for +# it. +WantedBy=graphical.target diff --git a/data/org.freedesktop.ConsoleKit.service.in b/data/org.freedesktop.ConsoleKit.service.in index d716a36..4db5f5a 100644 --- a/data/org.freedesktop.ConsoleKit.service.in +++ b/data/org.freedesktop.ConsoleKit.service.in @@ -1,4 +1,6 @@ [D-BUS Service] Name=org.freedesktop.ConsoleKit Exec=@sbindir@/console-kit-daemon --no-daemon +SystemdService= User=root +SystemdService=console-kit-daemon.service -- 1.7.0.1