* [PATCH 0/2] @ 2016-11-18 11:00 Hartmut Goebel 2016-11-18 11:00 ` [PATCH 1/2] doc: Symlink daemon start-up files Hartmut Goebel ` (2 more replies) 0 siblings, 3 replies; 16+ messages in thread From: Hartmut Goebel @ 2016-11-18 11:00 UTC (permalink / raw) To: guix-devel This series add two patches: * doc: Symlink daemon start-up files. This patch ensures that always the current profile's daemon will be used. This solve a minor issue I experienced when updating guix 0.10 to 0.11: The guix-daemon 0.10 was still used since the `guix-daemon.service` file, which was copied, contains the path to the 0.10 daemon. So I'm now using a sym-link always pointing to the current profile's .service file and thus using the current profile's guix-daemon. * Add system start-up files for "guix publish". This eases setting up a "guix publish" service, just for convenience for those who want it. Primary this is meant for use in the local network. Hopefully this will encourage people to provide more public stores - which at least could be used for "guix Hartmut Goebel (2): doc: Symlink daemon start-up files. Add system start-up files for "guix publish". .gitignore | 2 ++ doc/guix.texi | 38 ++++++++++++++++++++++++++++++++++++-- etc/guix-publish.conf.in | 12 ++++++++++++ etc/guix-publish.service.in | 19 +++++++++++++++++++ nix/local.mk | 16 ++++++++-------- 5 files changed, 77 insertions(+), 10 deletions(-) create mode 100644 etc/guix-publish.conf.in create mode 100644 etc/guix-publish.service.in -- 2.7.4 ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/2] doc: Symlink daemon start-up files. 2016-11-18 11:00 [PATCH 0/2] Hartmut Goebel @ 2016-11-18 11:00 ` Hartmut Goebel 2016-11-18 20:31 ` Leo Famulari 2016-11-18 11:00 ` [PATCH 2/2] Add system start-up files for "guix publish" Hartmut Goebel 2016-11-18 20:36 ` [PATCH 0/2] Leo Famulari 2 siblings, 1 reply; 16+ messages in thread From: Hartmut Goebel @ 2016-11-18 11:00 UTC (permalink / raw) To: guix-devel This patch ensures that always the current profile's daemon will be used. The .service file contains the path to the guix-daemon within the store. Thus when copying the file, it will point to the very version of guix-daemon used at the time of copying – even after system upgrade or when this version has been garbage collected from the store. * doc/guix.texi (Binary Installation): Change example code for installing the systemd and Upstart files to use symbolic links instead of copying the files. --- doc/guix.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index a3eba58..92d7ee8 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -453,7 +453,7 @@ If your host distro uses the systemd init system, this can be achieved with these commands: @example -# cp ~root/.guix-profile/lib/systemd/system/guix-daemon.service \ +# ln -s ~root/.guix-profile/lib/systemd/system/guix-daemon.service \ /etc/systemd/system/ # systemctl start guix-daemon && systemctl enable guix-daemon @end example @@ -461,7 +461,7 @@ with these commands: If your host distro uses the Upstart init system: @example -# cp ~root/.guix-profile/lib/upstart/system/guix-daemon.conf /etc/init/ +# ln -s ~root/.guix-profile/lib/upstart/system/guix-daemon.conf /etc/init/ # start guix-daemon @end example -- 2.7.4 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] doc: Symlink daemon start-up files. 2016-11-18 11:00 ` [PATCH 1/2] doc: Symlink daemon start-up files Hartmut Goebel @ 2016-11-18 20:31 ` Leo Famulari 2016-11-21 16:38 ` Hartmut Goebel 2017-01-15 18:23 ` Leo Famulari 0 siblings, 2 replies; 16+ messages in thread From: Leo Famulari @ 2016-11-18 20:31 UTC (permalink / raw) To: Hartmut Goebel; +Cc: guix-devel On Fri, Nov 18, 2016 at 12:00:33PM +0100, Hartmut Goebel wrote: > This patch ensures that always the current profile's daemon will be used. > > The .service file contains the path to the guix-daemon within the store. Thus > when copying the file, it will point to the very version of guix-daemon used > at the time of copying – even after system upgrade or when this version has > been garbage collected from the store. I'd argue it should point to /var/guix/profiles/per-user/root/... but I don't really care one way or the other since I often write my own systemd unit files since they are usually trivial. Actually, it looks like guix-daemon.service.in builds the path from @bindir@, so in my unprivileged Git work tree, guix-daemon.service execs /usr/local/bin/guix-daemon. This service wouldn't work for me since guix-daemon is not there. > * doc/guix.texi (Binary Installation): Change example code for installing > the systemd and Upstart files to use symbolic links instead of copying > the files. > --- > doc/guix.texi | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index a3eba58..92d7ee8 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -453,7 +453,7 @@ If your host distro uses the systemd init system, this can be achieved > with these commands: > > @example > -# cp ~root/.guix-profile/lib/systemd/system/guix-daemon.service \ > +# ln -s ~root/.guix-profile/lib/systemd/system/guix-daemon.service \ > /etc/systemd/system/ > # systemctl start guix-daemon && systemctl enable guix-daemon Does systemd allow symlinked unit files (aka service definitions)? I read this old discussion that says "No" [0] but it could have changed by now [1]. [0] https://bugzilla.redhat.com/show_bug.cgi?id=955379 [1] https://bugzilla.redhat.com/show_bug.cgi?id=1014311 > @end example > @@ -461,7 +461,7 @@ with these commands: > If your host distro uses the Upstart init system: > > @example > -# cp ~root/.guix-profile/lib/upstart/system/guix-daemon.conf /etc/init/ > +# ln -s ~root/.guix-profile/lib/upstart/system/guix-daemon.conf /etc/init/ > # start guix-daemon I don't know anything about upstart, so no comments here. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] doc: Symlink daemon start-up files. 2016-11-18 20:31 ` Leo Famulari @ 2016-11-21 16:38 ` Hartmut Goebel 2017-01-15 18:23 ` Leo Famulari 1 sibling, 0 replies; 16+ messages in thread From: Hartmut Goebel @ 2016-11-21 16:38 UTC (permalink / raw) To: Leo Famulari; +Cc: guix-devel Am 18.11.2016 um 21:31 schrieb Leo Famulari: > Does systemd allow symlinked unit files (aka service definitions)? I > read this old discussion that says "No" [0] but it could have changed by > now [1]. Yes it does. -- Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible | ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] doc: Symlink daemon start-up files. 2016-11-18 20:31 ` Leo Famulari 2016-11-21 16:38 ` Hartmut Goebel @ 2017-01-15 18:23 ` Leo Famulari 2017-01-15 19:23 ` Marius Bakke ` (2 more replies) 1 sibling, 3 replies; 16+ messages in thread From: Leo Famulari @ 2017-01-15 18:23 UTC (permalink / raw) To: Hartmut Goebel; +Cc: guix-devel [-- Attachment #1: Type: text/plain, Size: 1786 bytes --] On Fri, Nov 18, 2016 at 03:31:24PM -0500, Leo Famulari wrote: > On Fri, Nov 18, 2016 at 12:00:33PM +0100, Hartmut Goebel wrote: > > This patch ensures that always the current profile's daemon will be used. > > > > The .service file contains the path to the guix-daemon within the store. Thus > > when copying the file, it will point to the very version of guix-daemon used > > at the time of copying – even after system upgrade or when this version has > > been garbage collected from the store. I think we should go back to the "old way" of instructing users to copy the file... > I'd argue it should point to /var/guix/profiles/per-user/root/... ... and make the service file execute this path. > > @example > > -# cp ~root/.guix-profile/lib/systemd/system/guix-daemon.service \ > > +# ln -s ~root/.guix-profile/lib/systemd/system/guix-daemon.service \ > > /etc/systemd/system/ > > # systemctl start guix-daemon && systemctl enable guix-daemon Debian Jessie (their current stable release) doesn't support symlinked systemd service files yet [0], and we are frequently having to explain to new users why this step doesn't work for them. And, we also have to explain that the ExecStart value that contains the absolute store path must be changed to point to '/var/guix/profiles...'. Doing it that way has the same effect of a symlinked file that is updated automatically: the daemon is always the latest in root's profile. It feels like we having to walk new users through this on IRC or help-guix every day. It takes our time and makes their first experience with Guix harder than it should be. WDYT? [0] Jessie uses Systemd 215: https://packages.debian.org/search?keywords=systemd What about CentOS 7? Other distros? [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] doc: Symlink daemon start-up files. 2017-01-15 18:23 ` Leo Famulari @ 2017-01-15 19:23 ` Marius Bakke 2017-01-16 9:49 ` Ludovic Courtès 2017-01-16 10:02 ` Hartmut Goebel 2 siblings, 0 replies; 16+ messages in thread From: Marius Bakke @ 2017-01-15 19:23 UTC (permalink / raw) To: Leo Famulari, Hartmut Goebel; +Cc: guix-devel [-- Attachment #1: Type: text/plain, Size: 2041 bytes --] Leo Famulari <leo@famulari.name> writes: > On Fri, Nov 18, 2016 at 03:31:24PM -0500, Leo Famulari wrote: >> On Fri, Nov 18, 2016 at 12:00:33PM +0100, Hartmut Goebel wrote: >> > This patch ensures that always the current profile's daemon will be used. >> > >> > The .service file contains the path to the guix-daemon within the store. Thus >> > when copying the file, it will point to the very version of guix-daemon used >> > at the time of copying – even after system upgrade or when this version has >> > been garbage collected from the store. > > I think we should go back to the "old way" of instructing users to copy > the file... > >> I'd argue it should point to /var/guix/profiles/per-user/root/... > > ... and make the service file execute this path. > >> > @example >> > -# cp ~root/.guix-profile/lib/systemd/system/guix-daemon.service \ >> > +# ln -s ~root/.guix-profile/lib/systemd/system/guix-daemon.service \ >> > /etc/systemd/system/ >> > # systemctl start guix-daemon && systemctl enable guix-daemon > > Debian Jessie (their current stable release) doesn't support symlinked > systemd service files yet [0], and we are frequently having to explain > to new users why this step doesn't work for them. And, we also have to > explain that the ExecStart value that contains the absolute store path > must be changed to point to '/var/guix/profiles...'. > > Doing it that way has the same effect of a symlinked file that is > updated automatically: the daemon is always the latest in root's > profile. > > It feels like we having to walk new users through this on IRC or > help-guix every day. > > It takes our time and makes their first experience with Guix harder than > it should be. > > WDYT? This seems reasonable to me. I've started using /var/guix/profiles.. on foreign distros as well, even those with recent systemd. In addition to the above, using that path also avoids having to call 'systemctl daemon-reload' before restarting guix-daemon after updates... [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 487 bytes --] ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] doc: Symlink daemon start-up files. 2017-01-15 18:23 ` Leo Famulari 2017-01-15 19:23 ` Marius Bakke @ 2017-01-16 9:49 ` Ludovic Courtès 2017-03-05 20:55 ` Leo Famulari 2017-01-16 10:02 ` Hartmut Goebel 2 siblings, 1 reply; 16+ messages in thread From: Ludovic Courtès @ 2017-01-16 9:49 UTC (permalink / raw) To: Leo Famulari; +Cc: guix-devel Leo Famulari <leo@famulari.name> skribis: > On Fri, Nov 18, 2016 at 03:31:24PM -0500, Leo Famulari wrote: >> On Fri, Nov 18, 2016 at 12:00:33PM +0100, Hartmut Goebel wrote: >> > This patch ensures that always the current profile's daemon will be used. >> > >> > The .service file contains the path to the guix-daemon within the store. Thus >> > when copying the file, it will point to the very version of guix-daemon used >> > at the time of copying – even after system upgrade or when this version has >> > been garbage collected from the store. > > I think we should go back to the "old way" of instructing users to copy > the file... > >> I'd argue it should point to /var/guix/profiles/per-user/root/... > > ... and make the service file execute this path. > >> > @example >> > -# cp ~root/.guix-profile/lib/systemd/system/guix-daemon.service \ >> > +# ln -s ~root/.guix-profile/lib/systemd/system/guix-daemon.service \ >> > /etc/systemd/system/ >> > # systemctl start guix-daemon && systemctl enable guix-daemon > > Debian Jessie (their current stable release) doesn't support symlinked > systemd service files yet [0], and we are frequently having to explain > to new users why this step doesn't work for them. And, we also have to > explain that the ExecStart value that contains the absolute store path > must be changed to point to '/var/guix/profiles...'. > > Doing it that way has the same effect of a symlinked file that is > updated automatically: the daemon is always the latest in root's > profile. > > It feels like we having to walk new users through this on IRC or > help-guix every day. I’m convinced. :-) Hartmut, WDYT? Could you send a patch? Thanks for the heads-up (and for helping out people on IRC!). Ludo’. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] doc: Symlink daemon start-up files. 2017-01-16 9:49 ` Ludovic Courtès @ 2017-03-05 20:55 ` Leo Famulari 2017-03-06 9:10 ` Hartmut Goebel 2017-03-06 10:23 ` Ludovic Courtès 0 siblings, 2 replies; 16+ messages in thread From: Leo Famulari @ 2017-03-05 20:55 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guix-devel [-- Attachment #1.1: Type: text/plain, Size: 546 bytes --] On Mon, Jan 16, 2017 at 10:49:32AM +0100, Ludovic Courtès wrote: > > On Fri, Nov 18, 2016 at 03:31:24PM -0500, Leo Famulari wrote: > > I think we should go back to the "old way" of instructing users to copy > > the file... > > > >> I'd argue it should point to /var/guix/profiles/per-user/root/... > > > > ... and make the service file execute this path. > > Could you send a patch? I've attached two patches. The first updates the instructions in the manual, and the second builds the service files with the '/var/guix...' path. [-- Attachment #1.2: 0001-Revert-doc-Symlink-daemon-start-up-files.patch --] [-- Type: text/plain, Size: 1411 bytes --] From 62249ac64fb5cd0235bba28197cb7ac697719b83 Mon Sep 17 00:00:00 2001 From: Leo Famulari <leo@famulari.name> Date: Sun, 5 Mar 2017 14:04:34 -0500 Subject: [PATCH 1/2] Revert "doc: Symlink daemon start-up files." This reverts commit b7230de54b493da5a78922b4226255763b525a98. Versions of systemd that supported symlinked service files are not yet widely deployed. See this thread for more information: http://lists.gnu.org/archive/html/guix-devel/2017-01/msg01199.html --- doc/guix.texi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 7c7729859..21ddb6916 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -444,7 +444,7 @@ If your host distro uses the systemd init system, this can be achieved with these commands: @example -# ln -s ~root/.guix-profile/lib/systemd/system/guix-daemon.service \ +# cp ~root/.guix-profile/lib/systemd/system/guix-daemon.service \ /etc/systemd/system/ # systemctl start guix-daemon && systemctl enable guix-daemon @end example @@ -452,8 +452,8 @@ with these commands: If your host distro uses the Upstart init system: @example -# ln -s ~root/.guix-profile/lib/upstart/system/guix-daemon.conf /etc/init/ # initctl reload-configuration +# cp ~root/.guix-profile/lib/upstart/system/guix-daemon.conf /etc/init/ # start guix-daemon @end example -- 2.12.0 [-- Attachment #1.3: 0002-build-Don-t-embed-absolute-paths-in-.service-and-.co.patch --] [-- Type: text/plain, Size: 3580 bytes --] From b79385c076ba4921fdf5f3ad2af76d3d171515c8 Mon Sep 17 00:00:00 2001 From: Leo Famulari <leo@famulari.name> 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 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] doc: Symlink daemon start-up files. 2017-03-05 20:55 ` Leo Famulari @ 2017-03-06 9:10 ` Hartmut Goebel 2017-03-06 10:23 ` Ludovic Courtès 1 sibling, 0 replies; 16+ messages in thread From: Hartmut Goebel @ 2017-03-06 9:10 UTC (permalink / raw) To: Leo Famulari, Ludovic Courtès; +Cc: guix-devel Am 05.03.2017 um 21:55 schrieb Leo Famulari: > I've attached two patches. The first updates the instructions in the > manual, and the second builds the service files with the '/var/guix...' > path. LGTM -- Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible | ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] doc: Symlink daemon start-up files. 2017-03-05 20:55 ` Leo Famulari 2017-03-06 9:10 ` Hartmut Goebel @ 2017-03-06 10:23 ` Ludovic Courtès 1 sibling, 0 replies; 16+ messages in thread From: Ludovic Courtès @ 2017-03-06 10:23 UTC (permalink / raw) To: Leo Famulari; +Cc: guix-devel Leo Famulari <leo@famulari.name> skribis: > On Mon, Jan 16, 2017 at 10:49:32AM +0100, Ludovic Courtès wrote: >> > On Fri, Nov 18, 2016 at 03:31:24PM -0500, Leo Famulari wrote: >> > I think we should go back to the "old way" of instructing users to copy >> > the file... >> > >> >> I'd argue it should point to /var/guix/profiles/per-user/root/... >> > >> > ... and make the service file execute this path. >> >> Could you send a patch? > > I've attached two patches. The first updates the instructions in the > manual, and the second builds the service files with the '/var/guix...' > path. > > From 62249ac64fb5cd0235bba28197cb7ac697719b83 Mon Sep 17 00:00:00 2001 > From: Leo Famulari <leo@famulari.name> > Date: Sun, 5 Mar 2017 14:04:34 -0500 > Subject: [PATCH 1/2] Revert "doc: Symlink daemon start-up files." > > This reverts commit b7230de54b493da5a78922b4226255763b525a98. > > Versions of systemd that supported symlinked service files are not yet widely > deployed. > > See this thread for more information: > http://lists.gnu.org/archive/html/guix-devel/2017-01/msg01199.html Could you add this reference in a @c comment in the .texi file? Otherwise LGTM! > From b79385c076ba4921fdf5f3ad2af76d3d171515c8 Mon Sep 17 00:00:00 2001 > From: Leo Famulari <leo@famulari.name> > 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@. OK. Thanks for addressing this! Ludo’. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 1/2] doc: Symlink daemon start-up files. 2017-01-15 18:23 ` Leo Famulari 2017-01-15 19:23 ` Marius Bakke 2017-01-16 9:49 ` Ludovic Courtès @ 2017-01-16 10:02 ` Hartmut Goebel 2 siblings, 0 replies; 16+ messages in thread From: Hartmut Goebel @ 2017-01-16 10:02 UTC (permalink / raw) To: Leo Famulari; +Cc: guix-devel Am 15.01.2017 um 19:23 schrieb Leo Famulari: > Debian Jessie (their current stable release) doesn't support symlinked > systemd service files yet [0], If it does not work, we should of course revert this change. So you where right already at Nov 18 :-) -- Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible | ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/2] Add system start-up files for "guix publish". 2016-11-18 11:00 [PATCH 0/2] Hartmut Goebel 2016-11-18 11:00 ` [PATCH 1/2] doc: Symlink daemon start-up files Hartmut Goebel @ 2016-11-18 11:00 ` Hartmut Goebel 2016-11-18 20:35 ` Leo Famulari 2016-11-21 8:52 ` Ludovic Courtès 2016-11-18 20:36 ` [PATCH 0/2] Leo Famulari 2 siblings, 2 replies; 16+ messages in thread From: Hartmut Goebel @ 2016-11-18 11:00 UTC (permalink / raw) To: guix-devel * .gitignore: add etc/guix-publish.conf and /etc/guix-publish.service. * etc/guix-publish.conf.in: New file. * etc/guix-publish.service.in: New file. * nix/local.mk (etc/guix-%.service, etc/guix-%.conf): Generalized former build-rules for by using patterns. (nodist_systemdservice_DATA): Add etc/guix-publish.service, update comment. (nodist_upstartjob_DATA): Add etc/guix-publish.conf, update comment. * doc/guix.texi (Binary Installation): Add step for setting up "guix publish" to start at system start using the new files. --- .gitignore | 2 ++ doc/guix.texi | 34 ++++++++++++++++++++++++++++++++++ etc/guix-publish.conf.in | 12 ++++++++++++ etc/guix-publish.service.in | 19 +++++++++++++++++++ nix/local.mk | 16 ++++++++-------- 5 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 etc/guix-publish.conf.in create mode 100644 etc/guix-publish.service.in diff --git a/.gitignore b/.gitignore index 6e892ca..7db5e9f 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,8 @@ /emacs/guix-helper.scm /etc/guix-daemon.conf /etc/guix-daemon.service +/etc/guix-publish.conf +/etc/guix-publish.service /guix-daemon /guix-register /guix/config.scm diff --git a/doc/guix.texi b/doc/guix.texi index 92d7ee8..760639f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -504,6 +504,40 @@ To use substitutes from @code{hydra.gnu.org} or one of its mirrors @example # guix archive --authorize < ~root/.guix-profile/share/guix/hydra.gnu.org.pub @end example + +@item +(Optional) You may want to publish the content of your store for other +systems in your network. For this run +@example +# guix archive --generate-key +# useradd -U -d /var/empty -s `which nologin` \ + -c "Guix publish user" --system \ + guixpublish +@end example + +Set @command{guix publish} to automatically start on boot. + +If your host distro uses the systemd init system, this can be achieved +with these commands: + +@example +# ln -s ~root/.guix-profile/lib/systemd/system/guix-publish.service \ + /etc/systemd/system/ +# systemctl start guix-publish && systemctl enable guix-publish +@end example + +If your host distro uses the Upstart init system: + +@example +# ln -s ~root/.guix-profile/lib/upstart/system/guix-publish.conf /etc/init/ +# start guix-publish +@end example + +Otherwise, you can still start @command{guix publish} manually with: + +@example +# ~root/.guix-profile/bin/guix publish --user=guixpublish +@end example @end enumerate This completes root-level install of Guix. Each user will need to diff --git a/etc/guix-publish.conf.in b/etc/guix-publish.conf.in new file mode 100644 index 0000000..bf8b3f3 --- /dev/null +++ b/etc/guix-publish.conf.in @@ -0,0 +1,12 @@ +# This is a "job" for the Upstart init system to launch 'guix-daemon'. +# Drop it in /etc/init to have 'guix-daemon' automatically started. + +description "Publish the GNU Guix store" + +start on runlevel [2345] + +stop on runlevel [016] + +task + +exec @bindir@/guix publish --user=guixpublish --port=8181 diff --git a/etc/guix-publish.service.in b/etc/guix-publish.service.in new file mode 100644 index 0000000..bb3069c --- /dev/null +++ b/etc/guix-publish.service.in @@ -0,0 +1,19 @@ +# This is a "service unit file" for the systemd init system to launch +# 'guix publish'. Drop it in /etc/systemd/system or similar to have +# 'guix publish' automatically started. + +[Unit] +Description=Publish the GNU Guix store + +[Service] +ExecStart=@bindir@/guix publish --user=guixpublish --port=8181 +Environment=GUIX_LOCPATH=/root/.guix-profile/lib/locale +RemainAfterExit=yes +StandardOutput=syslog +StandardError=syslog + +# See <https://lists.gnu.org/archive/html/guix-devel/2016-04/msg00608.html>. +TasksMax=1024 + +[Install] +WantedBy=multi-user.target diff --git a/nix/local.mk b/nix/local.mk index c666edd..6cdcc84 100644 --- a/nix/local.mk +++ b/nix/local.mk @@ -180,26 +180,26 @@ endif BUILD_DAEMON_OFFLOAD nodist_libexec_SCRIPTS = \ %D%/scripts/guix-authenticate -# The '.service' file for systemd. +# The '.service' files for systemd. systemdservicedir = $(libdir)/systemd/system -nodist_systemdservice_DATA = etc/guix-daemon.service +nodist_systemdservice_DATA = etc/guix-daemon.service etc/guix-publish.service -etc/guix-daemon.service: etc/guix-daemon.service.in \ +etc/guix-%.service: etc/guix-%.service.in \ $(top_builddir)/config.status $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ $(SED) -e 's|@''bindir''@|$(bindir)|' < \ - "$(srcdir)/etc/guix-daemon.service.in" > "$@.tmp"; \ + "$(srcdir)/$<" > "$@.tmp"; \ mv "$@.tmp" "$@" -# The '.conf' job for Upstart. +# The '.conf' jobs for Upstart. upstartjobdir = $(libdir)/upstart/system -nodist_upstartjob_DATA = etc/guix-daemon.conf +nodist_upstartjob_DATA = etc/guix-daemon.conf etc/guix-publish.conf -etc/guix-daemon.conf: etc/guix-daemon.conf.in \ +etc/guix-%.conf: etc/guix-%.conf.in \ $(top_builddir)/config.status $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \ $(SED) -e 's|@''bindir''@|$(bindir)|' < \ - "$(srcdir)/etc/guix-daemon.conf.in" > "$@.tmp"; \ + "$(srcdir)/$<" > "$@.tmp"; \ mv "$@.tmp" "$@" EXTRA_DIST += \ -- 2.7.4 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 2/2] Add system start-up files for "guix publish". 2016-11-18 11:00 ` [PATCH 2/2] Add system start-up files for "guix publish" Hartmut Goebel @ 2016-11-18 20:35 ` Leo Famulari 2016-11-21 8:52 ` Ludovic Courtès 1 sibling, 0 replies; 16+ messages in thread From: Leo Famulari @ 2016-11-18 20:35 UTC (permalink / raw) To: Hartmut Goebel; +Cc: guix-devel On Fri, Nov 18, 2016 at 12:00:34PM +0100, Hartmut Goebel wrote: > * .gitignore: add etc/guix-publish.conf and /etc/guix-publish.service. > * etc/guix-publish.conf.in: New file. > * etc/guix-publish.service.in: New file. > * nix/local.mk (etc/guix-%.service, etc/guix-%.conf): Generalized former > build-rules for by using patterns. > (nodist_systemdservice_DATA): Add etc/guix-publish.service, update > comment. > (nodist_upstartjob_DATA): Add etc/guix-publish.conf, update comment. > * doc/guix.texi (Binary Installation): Add step for setting up "guix > publish" to start at system start using the new files. The changes related to systemd LGTM. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/2] Add system start-up files for "guix publish". 2016-11-18 11:00 ` [PATCH 2/2] Add system start-up files for "guix publish" Hartmut Goebel 2016-11-18 20:35 ` Leo Famulari @ 2016-11-21 8:52 ` Ludovic Courtès 2016-11-21 17:17 ` Hartmut Goebel 1 sibling, 1 reply; 16+ messages in thread From: Ludovic Courtès @ 2016-11-21 8:52 UTC (permalink / raw) To: Hartmut Goebel; +Cc: guix-devel Hartmut Goebel <h.goebel@crazy-compilers.com> skribis: > * .gitignore: add etc/guix-publish.conf and /etc/guix-publish.service. > * etc/guix-publish.conf.in: New file. > * etc/guix-publish.service.in: New file. > * nix/local.mk (etc/guix-%.service, etc/guix-%.conf): Generalized former > build-rules for by using patterns. > (nodist_systemdservice_DATA): Add etc/guix-publish.service, update > comment. > (nodist_upstartjob_DATA): Add etc/guix-publish.conf, update comment. > * doc/guix.texi (Binary Installation): Add step for setting up "guix > publish" to start at system start using the new files. Good idea! > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -504,6 +504,40 @@ To use substitutes from @code{hydra.gnu.org} or one of its mirrors > @example > # guix archive --authorize < ~root/.guix-profile/share/guix/hydra.gnu.org.pub > @end example > + > +@item > +(Optional) You may want to publish the content of your store for other > +systems in your network. For this run > +@example > +# guix archive --generate-key > +# useradd -U -d /var/empty -s `which nologin` \ > + -c "Guix publish user" --system \ > + guixpublish > +@end example > + > +Set @command{guix publish} to automatically start on boot. > + > +If your host distro uses the systemd init system, this can be achieved > +with these commands: > + > +@example > +# ln -s ~root/.guix-profile/lib/systemd/system/guix-publish.service \ > + /etc/systemd/system/ > +# systemctl start guix-publish && systemctl enable guix-publish > +@end example > + > +If your host distro uses the Upstart init system: > + > +@example > +# ln -s ~root/.guix-profile/lib/upstart/system/guix-publish.conf /etc/init/ > +# start guix-publish > +@end example > + > +Otherwise, you can still start @command{guix publish} manually with: > + > +@example > +# ~root/.guix-profile/bin/guix publish --user=guixpublish > +@end example > @end enumerate I think this should rather go to “Invoking guix publish”, to avoid making “Binary Installation” too intimidating (and because users do not initially care about running ‘guix publish’). WDYT? Also, I think it would be enough to add a cross-reference to “Invoking guix archive” where we mention that a key needs to be generated. Last, I think we should simply recommend user ‘nobody’, which we can expect to be already present. It does the job and will make the instructions shorter. WDYT? The rest LGTM, thanks! Ludo’. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/2] Add system start-up files for "guix publish". 2016-11-21 8:52 ` Ludovic Courtès @ 2016-11-21 17:17 ` Hartmut Goebel 0 siblings, 0 replies; 16+ messages in thread From: Hartmut Goebel @ 2016-11-21 17:17 UTC (permalink / raw) To: Ludovic Courtès; +Cc: guix-devel Am 21.11.2016 um 09:52 schrieb Ludovic Courtès: > I think this should rather go to “Invoking guix publish”, to avoid > making “Binary Installation” too intimidating (and because users do not > initially care about running ‘guix publish’). WDYT? > > Also, I think it would be enough to add a cross-reference to “Invoking > guix archive” where we mention that a key needs to be generated. Invoking guix publish is the perfect place: There already is a paragraph about enabling the service on GuixSD and also a reference to guix archive. Thanks for pointing there. -- Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible | ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 0/2] 2016-11-18 11:00 [PATCH 0/2] Hartmut Goebel 2016-11-18 11:00 ` [PATCH 1/2] doc: Symlink daemon start-up files Hartmut Goebel 2016-11-18 11:00 ` [PATCH 2/2] Add system start-up files for "guix publish" Hartmut Goebel @ 2016-11-18 20:36 ` Leo Famulari 2 siblings, 0 replies; 16+ messages in thread From: Leo Famulari @ 2016-11-18 20:36 UTC (permalink / raw) To: Hartmut Goebel; +Cc: guix-devel On Fri, Nov 18, 2016 at 12:00:32PM +0100, Hartmut Goebel wrote: > This series add two patches: > > * doc: Symlink daemon start-up files. > > This patch ensures that always the current profile's daemon will be used. > > This solve a minor issue I experienced when updating guix 0.10 to 0.11: The > guix-daemon 0.10 was still used since the `guix-daemon.service` file, which > was copied, contains the path to the 0.10 daemon. So I'm now using a > sym-link always pointing to the current profile's .service file and thus > using the current profile's guix-daemon. > > * Add system start-up files for "guix publish". > > This eases setting up a "guix publish" service, just for convenience for > those who want it. Primary this is meant for use in the local network. > Hopefully this will encourage people to provide more public stores - which > at least could be used for "guix Could be used for "guix what? ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2017-03-06 10:23 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-11-18 11:00 [PATCH 0/2] Hartmut Goebel 2016-11-18 11:00 ` [PATCH 1/2] doc: Symlink daemon start-up files Hartmut Goebel 2016-11-18 20:31 ` Leo Famulari 2016-11-21 16:38 ` Hartmut Goebel 2017-01-15 18:23 ` Leo Famulari 2017-01-15 19:23 ` Marius Bakke 2017-01-16 9:49 ` Ludovic Courtès 2017-03-05 20:55 ` Leo Famulari 2017-03-06 9:10 ` Hartmut Goebel 2017-03-06 10:23 ` Ludovic Courtès 2017-01-16 10:02 ` Hartmut Goebel 2016-11-18 11:00 ` [PATCH 2/2] Add system start-up files for "guix publish" Hartmut Goebel 2016-11-18 20:35 ` Leo Famulari 2016-11-21 8:52 ` Ludovic Courtès 2016-11-21 17:17 ` Hartmut Goebel 2016-11-18 20:36 ` [PATCH 0/2] Leo Famulari
Code repositories for project(s) associated with this public inbox https://git.savannah.gnu.org/cgit/guix.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).