unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [Patch v2 0/2] Symlink daemon start-up files and guix publish
@ 2016-11-21 17:33 Hartmut Goebel
  2016-11-21 17:33 ` [Patch v2 1/2] doc: Symlink daemon start-up files Hartmut Goebel
  2016-11-21 17:33 ` [Patch v2 2/2] Add system start-up files for "guix publish" Hartmut Goebel
  0 siblings, 2 replies; 6+ messages in thread
From: Hartmut Goebel @ 2016-11-21 17:33 UTC (permalink / raw)
  To: guix-devel

Update:
patch 1: Unchanged
patch 2: Text in docum moved to "Invoking guix publish" as suggested by Ludo

      	 Any better idea than using bullet-points here?


* 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 challenge".

*** BLURB HERE ***

Hartmut Goebel (2):
  doc: Symlink daemon start-up files.
  Add system start-up files for "guix publish".

 .gitignore                  |  2 ++
 doc/guix.texi               | 25 +++++++++++++++++++++++--
 etc/guix-publish.conf.in    | 12 ++++++++++++
 etc/guix-publish.service.in | 19 +++++++++++++++++++
 nix/local.mk                | 16 ++++++++--------
 5 files changed, 64 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] 6+ messages in thread

* [Patch v2 1/2] doc: Symlink daemon start-up files.
  2016-11-21 17:33 [Patch v2 0/2] Symlink daemon start-up files and guix publish Hartmut Goebel
@ 2016-11-21 17:33 ` Hartmut Goebel
  2016-11-23 21:22   ` Ludovic Courtès
  2016-11-21 17:33 ` [Patch v2 2/2] Add system start-up files for "guix publish" Hartmut Goebel
  1 sibling, 1 reply; 6+ messages in thread
From: Hartmut Goebel @ 2016-11-21 17:33 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 3a88dd4..4a921f2 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] 6+ messages in thread

* [Patch v2 2/2] Add system start-up files for "guix publish".
  2016-11-21 17:33 [Patch v2 0/2] Symlink daemon start-up files and guix publish Hartmut Goebel
  2016-11-21 17:33 ` [Patch v2 1/2] doc: Symlink daemon start-up files Hartmut Goebel
@ 2016-11-21 17:33 ` Hartmut Goebel
  2016-11-23 21:25   ` Ludovic Courtès
  1 sibling, 1 reply; 6+ messages in thread
From: Hartmut Goebel @ 2016-11-21 17:33 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 (Invoking guix publish): Add description for enabling
  "guix publish" on host distros using the new files.
---
 .gitignore                  |  2 ++
 doc/guix.texi               | 21 +++++++++++++++++++++
 etc/guix-publish.conf.in    | 12 ++++++++++++
 etc/guix-publish.service.in | 19 +++++++++++++++++++
 nix/local.mk                | 16 ++++++++--------
 5 files changed, 62 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 329d489..b64f5ef 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 4a921f2..e751cd6 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -6055,6 +6055,27 @@ add a call to @code{guix-publish-service} in the @code{services} field
 of the @code{operating-system} declaration (@pxref{guix-publish-service,
 @code{guix-publish-service}}).
 
+If you are running Guix on top of host distro, this can be achieved with
+the following commands.
+
+@itemize
+@item
+If your host distro uses the systemd init system:
+
+@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
+
+@item
+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
+@end itemize
 
 @node Invoking guix challenge
 @section Invoking @command{guix challenge}
diff --git a/etc/guix-publish.conf.in b/etc/guix-publish.conf.in
new file mode 100644
index 0000000..498fa29
--- /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=nobody --port=8181
diff --git a/etc/guix-publish.service.in b/etc/guix-publish.service.in
new file mode 100644
index 0000000..fc4e3c2
--- /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=nobody --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 86ef769..79667ed 100644
--- a/nix/local.mk
+++ b/nix/local.mk
@@ -183,26 +183,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] 6+ messages in thread

* Re: [Patch v2 1/2] doc: Symlink daemon start-up files.
  2016-11-21 17:33 ` [Patch v2 1/2] doc: Symlink daemon start-up files Hartmut Goebel
@ 2016-11-23 21:22   ` Ludovic Courtès
  0 siblings, 0 replies; 6+ messages in thread
From: Ludovic Courtès @ 2016-11-23 21:22 UTC (permalink / raw)
  To: Hartmut Goebel; +Cc: guix-devel

Hartmut Goebel <h.goebel@crazy-compilers.com> skribis:

> 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.

OK!

Ludo'.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Patch v2 2/2] Add system start-up files for "guix publish".
  2016-11-21 17:33 ` [Patch v2 2/2] Add system start-up files for "guix publish" Hartmut Goebel
@ 2016-11-23 21:25   ` Ludovic Courtès
  2016-11-24  8:25     ` Hartmut Goebel
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2016-11-23 21:25 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 (Invoking guix publish): Add description for enabling
>   "guix publish" on host distros using the new files.

[...]

> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -6055,6 +6055,27 @@ add a call to @code{guix-publish-service} in the @code{services} field
>  of the @code{operating-system} declaration (@pxref{guix-publish-service,
>  @code{guix-publish-service}}).
>  
> +If you are running Guix on top of host distro, this can be achieved with
> +the following commands.

What about: “If you are instead running Guix on a ``foreign distro'',
follow these instructions:”

> +@itemize
> +@item
> +If your host distro uses the systemd init system:
> +
> +@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
> +
> +@item
> +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

Maybe add something like:

  @item
  Otherwise, proceed similarly with your distro's init system.

OK with these changes, thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Patch v2 2/2] Add system start-up files for "guix publish".
  2016-11-23 21:25   ` Ludovic Courtès
@ 2016-11-24  8:25     ` Hartmut Goebel
  0 siblings, 0 replies; 6+ messages in thread
From: Hartmut Goebel @ 2016-11-24  8:25 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Am 23.11.2016 um 22:25 schrieb Ludovic Courtès:
> OK with these changes, thank you!

Pushed with these changes.

-- 
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] 6+ messages in thread

end of thread, other threads:[~2016-11-24  8:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-21 17:33 [Patch v2 0/2] Symlink daemon start-up files and guix publish Hartmut Goebel
2016-11-21 17:33 ` [Patch v2 1/2] doc: Symlink daemon start-up files Hartmut Goebel
2016-11-23 21:22   ` Ludovic Courtès
2016-11-21 17:33 ` [Patch v2 2/2] Add system start-up files for "guix publish" Hartmut Goebel
2016-11-23 21:25   ` Ludovic Courtès
2016-11-24  8:25     ` Hartmut Goebel

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).