[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/06: Add 'guix-daemon.service' file for systemd.
From: |
Ludovic Court�s |
Subject: |
03/06: Add 'guix-daemon.service' file for systemd. |
Date: |
Wed, 15 Jul 2015 21:57:53 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit d2825c96141c7b6844d9e04f982919c0509165e1
Author: Ludovic Courtès <address@hidden>
Date: Wed Jul 15 17:13:16 2015 +0200
Add 'guix-daemon.service' file for systemd.
* etc/guix-daemon.service.in: New file, provided by Ricardo Wurmus.
* daemon.am (CLEANFILES): Add etc/guix-daemon.service.
(systemdservicedir, nodist_systemdservice_DATA): New variables.
(EXTRA_DIST): Add etc/guix-daemon.service.in.
* doc/guix.texi (Binary Installation, Build Environment Setup): Mention
'guix-daemon.service'.
---
.gitignore | 1 +
daemon.am | 15 +++++++++++++--
doc/guix.texi | 12 ++++++++++--
etc/guix-daemon.service.in | 15 +++++++++++++++
4 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/.gitignore b/.gitignore
index c1061d7..c7a6cdd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -125,3 +125,4 @@ GTAGS
/doc/os-config-bare-bones.texi
/doc/os-config-desktop.texi
/doc/*.1
+/etc/guix-daemon.service
diff --git a/daemon.am b/daemon.am
index eecfea1..1fee9b7 100644
--- a/daemon.am
+++ b/daemon.am
@@ -21,7 +21,7 @@
#
BUILT_SOURCES += nix/libstore/schema.sql.hh
-CLEANFILES += $(BUILT_SOURCES)
+CLEANFILES += $(BUILT_SOURCES) etc/guix-daemon.service
noinst_LIBRARIES = libformat.a libutil.a libstore.a
@@ -181,10 +181,21 @@ endif BUILD_DAEMON_OFFLOAD
nodist_libexec_SCRIPTS = \
nix/scripts/guix-authenticate
+# The '.service' file for systemd.
+systemdservicedir = $(libdir)/systemd/system
+nodist_systemdservice_DATA = etc/guix-daemon.service
+
+etc/guix-daemon.service: etc/guix-daemon.service.in \
+ $(top_builddir)/config.status
+ $(SED) -e 's|@''bindir''@|$(bindir)|' < \
+ "etc/guix-daemon.service.in" > "address@hidden"
+ mv "address@hidden" "$@"
+
EXTRA_DIST += \
nix/libstore/schema.sql \
nix/AUTHORS \
- nix/COPYING
+ nix/COPYING \
+ etc/guix-daemon.service.in
AM_TESTS_ENVIRONMENT += \
top_builddir="$(abs_top_builddir)"
diff --git a/doc/guix.texi b/doc/guix.texi
index 7d18c00..e4662cb 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -330,6 +330,10 @@ Run the daemon:
# ~root/.guix-profile/bin/guix-daemon --build-users-group=guixbuild
@end example
+On hosts using the systemd init system, drop
address@hidden/.guix-profile/lib/systemd/system/guix-daemon.service} in
address@hidden/etc/systemd/system}.
+
@item
Make the @command{guix} command available to other users on the machine,
for instance with:
@@ -512,8 +516,12 @@ Bash syntax and the @code{shadow} commands):
@noindent
The number of build users determines how many build jobs may run in
parallel, as specified by the @option{--max-jobs} option
-(@pxref{Invoking guix-daemon, @option{--max-jobs}}).
-The @code{guix-daemon} program may then be run as @code{root} with:
+(@pxref{Invoking guix-daemon, @option{--max-jobs}}). The
address@hidden program may then be run as @code{root} with the
+following address@hidden your machine uses the systemd init system,
+dropping the @address@hidden/lib/systemd/system/guix-daemon.service}
+file in @file{/etc/systemd/system} will ensure that
address@hidden is automatically started.}:
@example
# guix-daemon --build-users-group=guixbuild
diff --git a/etc/guix-daemon.service.in b/etc/guix-daemon.service.in
new file mode 100644
index 0000000..28ef000
--- /dev/null
+++ b/etc/guix-daemon.service.in
@@ -0,0 +1,15 @@
+# This is a "service unit file" for the systemd init system to launch
+# 'guix-daemon'. Drop it in /etc/systemd/system or similar to have
+# 'guix-daemon' automatically started.
+
+[Unit]
+Description=Build daemon for GNU Guix
+
+[Service]
address@hidden@/guix-daemon --build-users-group=guixbuild
+RemainAfterExit=yes
+StandardOutput=syslog
+StandardError=syslog
+
+[Install]
+WantedBy=multi-user.target
- branch master updated (b76c415 -> 68e88a0), Ludovic Court�s, 2015/07/15
- 05/06: size: Gracefully handle EPIPE., Ludovic Court�s, 2015/07/15
- 06/06: gnu: Update livestreamer to 1.12.2., Ludovic Court�s, 2015/07/15
- 04/06: ui: Add 'leave-on-EPIPE'., Ludovic Court�s, 2015/07/15
- 01/06: doc: Reinstate bit about creating build accounts., Ludovic Court�s, 2015/07/15
- 02/06: system: Make /dev/kvm 660., Ludovic Court�s, 2015/07/15
- 03/06: Add 'guix-daemon.service' file for systemd.,
Ludovic Court�s <=