guix-commits
[Top][All Lists]
Advanced

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

26/64: Install systemd units


From: Ludovic Courtès
Subject: 26/64: Install systemd units
Date: Mon, 05 Jan 2015 16:38:58 +0000

civodul pushed a commit to branch nix
in repository guix.

commit 84d6936371037559704337614c65007a8e61b5e1
Author: Eelco Dolstra <address@hidden>
Date:   Mon Apr 7 11:18:54 2014 +0200

    Install systemd units
---
 .gitignore                         |    3 +++
 Makefile                           |    1 +
 misc/systemd/local.mk              |    1 +
 misc/systemd/nix-daemon.service    |   10 ----------
 misc/systemd/nix-daemon.service.in |    9 +++++++++
 misc/systemd/nix-daemon.socket.in  |   11 +++++++++++
 nix.spec.in                        |    8 --------
 7 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/.gitignore b/.gitignore
index 76fc815..008f5de 100644
--- a/.gitignore
+++ b/.gitignore
@@ -108,6 +108,9 @@ Makefile.config
 /perl/lib/Nix/Config.pm
 /perl/lib/Nix/Store.cc
 
+/misc/systemd/nix-daemon.service
+/misc/systemd/nix-daemon.socket
+
 *.a
 *.o
 *.so
diff --git a/Makefile b/Makefile
index bcfa89d..77f22db 100644
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,7 @@ makefiles = \
   perl/local.mk \
   scripts/local.mk \
   corepkgs/local.mk \
+  misc/systemd/local.mk \
   misc/emacs/local.mk \
   doc/manual/local.mk \
   tests/local.mk
diff --git a/misc/systemd/local.mk b/misc/systemd/local.mk
new file mode 100644
index 0000000..a5f6131
--- /dev/null
+++ b/misc/systemd/local.mk
@@ -0,0 +1 @@
+$(foreach n, nix-daemon.socket nix-daemon.service, $(eval $(call 
install-file-in, $(d)/$(n), $(libdir)/systemd/system, 0644)))
diff --git a/misc/systemd/nix-daemon.service b/misc/systemd/nix-daemon.service
deleted file mode 100644
index ee28209..0000000
--- a/misc/systemd/nix-daemon.service
+++ /dev/null
@@ -1,10 +0,0 @@
-[Unit]
-Description=Helper daemon for managing secure, multi-user Nix stores
-After=syslog.target
-
-[Service]
-Type=simple
-ExecStart=/usr/bin/nix-daemon
-
-[Install]
-WantedBy=multi-user.target
diff --git a/misc/systemd/nix-daemon.service.in 
b/misc/systemd/nix-daemon.service.in
new file mode 100644
index 0000000..5fc04a3
--- /dev/null
+++ b/misc/systemd/nix-daemon.service.in
@@ -0,0 +1,9 @@
+[Unit]
+Description=Nix Daemon
address@hidden@
address@hidden@
address@hidden@/nix/daemon-socket
+
+[Service]
+ExecStart=@@bindir@/nix-daemon nix-daemon --daemon
+KillMode=process
diff --git a/misc/systemd/nix-daemon.socket.in 
b/misc/systemd/nix-daemon.socket.in
new file mode 100644
index 0000000..9ed39ff
--- /dev/null
+++ b/misc/systemd/nix-daemon.socket.in
@@ -0,0 +1,11 @@
+[Unit]
+Description=Nix Daemon Socket
+Before=multi-user.target
address@hidden@
address@hidden@/nix/daemon-socket
+
+[Socket]
address@hidden@/nix/daemon-socket/socket
+
+[Install]
+WantedBy=sockets.target
diff --git a/nix.spec.in b/nix.spec.in
index f067c38..1457308 100644
--- a/nix.spec.in
+++ b/nix.spec.in
@@ -132,14 +132,6 @@ done
 # (until this is fixed in the relevant Makefile)
 chmod -x $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/nix.sh
 
-# systemd not available on RHEL yet
-%if ! 0%{?rhel}
-# install systemd service descriptor
-mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/systemd/system
-cp -p misc/systemd/nix-daemon.service \
-  $RPM_BUILD_ROOT%{_prefix}/lib/systemd/system/
-%endif
-
 # Copy the byte-compiled mode file by hand
 cp -p misc/emacs/nix-mode.elc $RPM_BUILD_ROOT%{_emacs_sitelispdir}/
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]