From b79385c076ba4921fdf5f3ad2af76d3d171515c8 Mon Sep 17 00:00:00 2001 From: Leo Famulari Date: Sun, 5 Mar 2017 14:33:13 -0500 Subject: [PATCH 2/2] build: Don't embed absolute paths in .service and .conf service files. Otherwise, users will be stuck running an old copy of guix and the guix-daemon if they copy the service files instead of symlinking them. * etc/guix-daemon.conf.in, etc/guix-daemon.service.in, etc/guix-publish.conf.in, etc/guix-publish.service.in: Expand @localstatedir@ instead of @bindir@. * nix/local.mk (etc/guix-%.service, etc/guix-%.conf): Use @localstatedir@ instead of @bindir@. --- etc/guix-daemon.conf.in | 2 +- etc/guix-daemon.service.in | 2 +- etc/guix-publish.conf.in | 2 +- etc/guix-publish.service.in | 2 +- nix/local.mk | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/etc/guix-daemon.conf.in b/etc/guix-daemon.conf.in index 8f833cb69..09c70cde3 100644 --- a/etc/guix-daemon.conf.in +++ b/etc/guix-daemon.conf.in @@ -9,4 +9,4 @@ stop on runlevel [016] task -exec @bindir@/guix-daemon --build-users-group=guixbuild +exec @localstatedir@/guix/profiles/per-user/root/guix-profile/bin/guix-daemon --build-users-group=guixbuild diff --git a/etc/guix-daemon.service.in b/etc/guix-daemon.service.in index ab0ce090c..ffe4cf9bd 100644 --- a/etc/guix-daemon.service.in +++ b/etc/guix-daemon.service.in @@ -6,7 +6,7 @@ Description=Build daemon for GNU Guix [Service] -ExecStart=@bindir@/guix-daemon --build-users-group=guixbuild +ExecStart=@localstatedir@/guix/profiles/per-user/root/guix-profile/bin/guix-daemon --build-users-group=guixbuild Environment=GUIX_LOCPATH=/root/.guix-profile/lib/locale RemainAfterExit=yes StandardOutput=syslog diff --git a/etc/guix-publish.conf.in b/etc/guix-publish.conf.in index 498fa295b..241c59455 100644 --- a/etc/guix-publish.conf.in +++ b/etc/guix-publish.conf.in @@ -9,4 +9,4 @@ stop on runlevel [016] task -exec @bindir@/guix publish --user=nobody --port=8181 +exec @localstatedir@/guix/profiles/per-user/root/guix-profile/bin/guix publish --user=nobody --port=8181 diff --git a/etc/guix-publish.service.in b/etc/guix-publish.service.in index fc4e3c21f..8aaf09e3c 100644 --- a/etc/guix-publish.service.in +++ b/etc/guix-publish.service.in @@ -6,7 +6,7 @@ Description=Publish the GNU Guix store [Service] -ExecStart=@bindir@/guix publish --user=nobody --port=8181 +ExecStart=@localstatedir@/guix/profiles/per-user/root/guix-profile/bin/guix publish --user=nobody --port=8181 Environment=GUIX_LOCPATH=/root/.guix-profile/lib/locale RemainAfterExit=yes StandardOutput=syslog diff --git a/nix/local.mk b/nix/local.mk index eb70d266f..9e0c457be 100644 --- a/nix/local.mk +++ b/nix/local.mk @@ -190,7 +190,7 @@ nodist_systemdservice_DATA = etc/guix-daemon.service etc/guix-publish.service etc/guix-%.service: etc/guix-%.service.in \ $(top_builddir)/config.status $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ - $(SED) -e 's|@''bindir''@|$(bindir)|' < \ + $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' < \ "$<" > "$@.tmp"; \ mv "$@.tmp" "$@" @@ -201,7 +201,7 @@ nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf etc/guix-%.conf: etc/guix-%.conf.in \ $(top_builddir)/config.status $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ - $(SED) -e 's|@''bindir''@|$(bindir)|' < \ + $(SED) -e 's|@''localstatedir''@|$(localstatedir)|' < \ "$<" > "$@.tmp"; \ mv "$@.tmp" "$@" -- 2.12.0