Add how to create a runit service in step 5 of binary installation manual

  • Open
  • quality assurance status badge
Details
4 participants
  • Foxmean
  • Jan Nieuwenhuizen
  • Christopher Baines
  • Vincent Legoll
Owner
unassigned
Submitted by
Foxmean
Severity
normal
F
F
Foxmean wrote on 4 Oct 2019 17:38
(name . guix-patches@gnu.org)(address . guix-patches@gnu.org)
CX5xwH8x3VzW4l64gLl6gvrHPRJ8QIxdrkUf9Qkeq6lyg8E3pBHU06JgMqz_lUwCh0eTl65iXHNnDavOhB0QycJlfG6I9nbez78iq37h6X0=@protonmail.com
-> step 5 Run the daemon, and set it to automatically start on boot.

If your host distro uses the Runit system:

<code>
# mkdir /etc/sv/guix-daemon
</code>

Then create file /etc/sv/guix-daemon/run with your favorite text editor e.g. emacs.

<code>
# emacs /etc/sv/guix-daemon/run
</code>

And add this two line of code in the file.

<code>
#!/bin/sh
exec /var/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild
</code>

Now, you can enable and start guix-daemon service with:

<code>
# ln -s /etc/sv/guix-daemon /var/service/ && sv up guix-daemon
</code>

I would like to add it in etc and the manual at doc/guix.texi updated.
How can I contribute?

Sent with [ProtonMail](https://protonmail.com) Secure Email.
Attachment: file
J
J
Jan Nieuwenhuizen wrote on 5 Oct 2019 09:47
(name . Foxmean)(address . foxmean@protonmail.com)(address . 37624@debbugs.gnu.org)
87r23ry6oo.fsf@gnu.org
Foxmean writes:

Hello Foxmean,

Toggle quote (4 lines)
> I would like to add a patch in
> https://guix.gnu.org/manual/en/html_node/Binary-Installation.html#Binary-Installation
> -> step 5 Run the daemon, and set it to automatically start on boot.

That's great!

Toggle quote (6 lines)
> If your host distro uses the Runit system:
>
> <code>
> # mkdir /etc/sv/guix-daemon
> </code>

Okay. As you will see, <code> is coded as @example ... @end example.

Toggle quote (13 lines)
> Then create file /etc/sv/guix-daemon/run with your favorite text editor e.g. emacs.
>
> <code>
> # emacs /etc/sv/guix-daemon/run
> </code>
>
> And add this two line of code in the file.
>
> <code>
> #!/bin/sh
> exec /var/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild
> </code>

I would suggest you change this bit to resemble the other init systems:
this file to the repository for people to simply cp. You will have to
replace `/var' directory with the configurable `@localstatedir@'.

Toggle quote (9 lines)
> Now, you can enable and start guix-daemon service with:
>
> <code>
> # ln -s /etc/sv/guix-daemon /var/service/ && sv up guix-daemon
> </code>
>
> I would like to add it in etc and the manual at doc/guix.texi updated.
> How can I contribute?

You will need to create a patch to doc/guix.texi. You first need to
clone the guix git archive.

Have a look at the `Contributing' section in the manual, especially

Edit doc/guix.texi, check the result by building the manual:

make info
<visit doc/guix.info>

For the rest, follow the pattern used for the file

etc/guix-daemon.service.in

do not forget to add your file to

etc/local.mk

Commit your changes to git and reply to this bug with your patch. Feel
free to ask if you have any questions.

Greetings,
janneke

--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com| Avatar® http://AvatarAcademy.com
F
F
Foxmean wrote on 12 Oct 2019 21:30
Try to add Runit daemon setup in manual (install guix in existing GNU/Linux)
(name . 37624)(address . 37624@debbugs.gnu.org)
GNei9rCs86Wl_L9GCUEfU_grZaau_EtBraoGsCLdjA520Skzqu8S7l7tkqghffIYsUzd1N454XCCqgUSYgQNaCr7zeucpzdX9g3iW3dfgi8=@protonmail.com
I hope this can help you, even so a little.

ProtonMail????????

---???????---

Toggle quote (1 lines)
> ProtonMail????????
Attachment: file
From 0ff778ff5d7d17fef76b5abc14f274173fd263b8 Mon Sep 17 00:00:00 2001
From: Pathompong Kwangtong <foxmean@protonmail.com>
Date: Sun, 13 Oct 2019 01:24:48 +0700
Subject: [PATCH] Add Runit init system in guix installation

---
doc/guix.texi | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (38 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 6703c2756c..99068111bb 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -649,6 +649,31 @@ If your host distro uses the Upstart init system:
# start guix-daemon
@end example
+If your host distro use th Runit init system:
+
+@example
+# mkdir /etc/sv/guix-daemon
+@end example
+
+Then create file /etc/sv/guix-daemon/run with your favorite text editor e.g. emacs.
+
+@example
+# emacs /etc/sv/guix-daemon/run
+@end example
+
+And add this two line of code in the file.
+
+@example
+#!/bin/sh
+exec /var/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild
+@end example
+
+Now, you can enable and start guix-daemon service with:
+
+@example
+> # ln -s /etc/sv/guix-daemon /var/service/ && sv up guix-daemon
+@end example
+
Otherwise, you can still start the daemon manually with:
@example
--
2.23.0
F
F
Foxmean wrote on 12 Oct 2019 21:31
Try to add Runit daemon setup in documentation (install guix in existing GNU/Linux)
(address . 37624@debbugs.gnu.org)
fsX2IBFeHzIKtds1QwumVxUXJNDe4OCZSybGOsxSQ-DCj4L2VQRI8HskhWehqrePF4R90NCD508wiUub085bSeKRl20RD5GbHxFXXJYNmrY=@protonmail.com
Sorry for non-attach file email.

Sent with ProtonMail Secure Email.
Attachment: file
From 0ff778ff5d7d17fef76b5abc14f274173fd263b8 Mon Sep 17 00:00:00 2001
From: Pathompong Kwangtong <foxmean@protonmail.com>
Date: Sun, 13 Oct 2019 01:24:48 +0700
Subject: [PATCH] Add Runit init system in guix installation

---
doc/guix.texi | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (38 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 6703c2756c..99068111bb 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -649,6 +649,31 @@ If your host distro uses the Upstart init system:
# start guix-daemon
@end example
+If your host distro use th Runit init system:
+
+@example
+# mkdir /etc/sv/guix-daemon
+@end example
+
+Then create file /etc/sv/guix-daemon/run with your favorite text editor e.g. emacs.
+
+@example
+# emacs /etc/sv/guix-daemon/run
+@end example
+
+And add this two line of code in the file.
+
+@example
+#!/bin/sh
+exec /var/guix/profiles/per-user/root/current-guix/bin/guix-daemon --build-users-group=guixbuild
+@end example
+
+Now, you can enable and start guix-daemon service with:
+
+@example
+> # ln -s /etc/sv/guix-daemon /var/service/ && sv up guix-daemon
+@end example
+
Otherwise, you can still start the daemon manually with:
@example
--
2.23.0
V
V
V
Vincent Legoll wrote on 14 Apr 2020 00:29
(name . Foxmean)(address . foxmean@protonmail.com)
712fb208-43c4-6a30-b0c8-04198a51db8f@gmail.com
On 14/04/2020 00:22, Vincent Legoll wrote:
Toggle quote (13 lines)
> Hello,
>
>
> as I recently worked on the same subject in [1],
>
> I reviewed and amended the documentation patch [2].
>
>
> [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40601
>
> [2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=37624
>

And now with the patch...
From 6b656a54ef7a17fdbd5f82ceaeb98198e2c241af Mon Sep 17 00:00:00 2001
From: Pathompong Kwangtong <foxmean@protonmail.com>
Date: Sun, 13 Oct 2019 01:24:48 +0700
Subject: [PATCH] doc: Add Runit init system in guix installation.

* doc/guix.texi (Binary Installation): Add runit section.
* .mailmap: Add author email adress.

Co-authored-by: Vincent Legoll <vincent.legoll@gmail.com>
---
.mailmap | 1 +
doc/guix.texi | 30 ++++++++++++++++++++++++++++++
2 files changed, 31 insertions(+)

Toggle diff (62 lines)
diff --git a/.mailmap b/.mailmap
index 97018775f6..aa5227b91d 100644
--- a/.mailmap
+++ b/.mailmap
@@ -62,6 +62,7 @@ ng0 <ng0@n0.is> <ngillmann@runbox.com>
ng0 <ng0@n0.is> <niasterisk@grrlz.net>
ng0 <ng0@n0.is> <ng@niasterisk.space>
ng0 <ng0@n0.is> <ng0@libertad.pw>
+Pathompong Kwangtong <foxmean@protonmail.com>
Pierre Neidhardt <mail@ambrevar.xyz>
Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
Pjotr Prins <pjotr.guix@thebird.nl> <pjotr.public01@thebird.nl>
diff --git a/doc/guix.texi b/doc/guix.texi
index 8bf4ef9b74..94cb89eddf 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -71,6 +71,7 @@ Copyright @copyright{} 2019 Alex Griffin@*
Copyright @copyright{} 2019 Guillaume Le Vaillant@*
Copyright @copyright{} 2020 Leo Prikler@*
Copyright @copyright{} 2019, 2020 Simon Tournier@*
+Copyright @copyright{} 2019 Pathompong Kwangtong@*
Copyright @copyright{} 2020 Wiktor ?elazny@*
Copyright @copyright{} 2020 Damien Cassou@*
Copyright @copyright{} 2020 Jakub K?dzio?ka@*
@@ -664,6 +665,35 @@ If your host distro uses the Upstart init system:
# start guix-daemon
@end example
+If your host distro use the Runit init system:
+
+@example
+# mkdir /etc/sv/guix-daemon
+@end example
+
+Then create the guix-daemon runit launch script:
+
+@example
+# cat > /etc/sv/guix-daemon/run <<EOF
+#!/bin/sh
+
+GUIX_LOCPATH=/var/guix/profiles/per-user/root/guix-profile/lib/locale
+LC_ALL=en_US.utf8
+
+export GUIX_LOCPATH LC_ALL
+
+exec /var/guix/profiles/per-user/root/current-guix/bin/guix-daemon \
+ --build-users-group=guixbuild
+EOF
+@end example
+
+Now, you can enable and start the guix-daemon service with:
+
+@example
+# ln -s /etc/sv/guix-daemon /etc/runit/runsvdir/default/
+# sv up guix-daemon
+@end example
+
Otherwise, you can still start the daemon manually with:
@example
--
2.20.1
C
C
Christopher Baines wrote on 18 Dec 2020 14:35
Re: [bug#37624] [PATCH v2] Re: Add how to create a runit service in step 5 of binary installation manual
(name . Vincent Legoll)(address . vincent.legoll@gmail.com)
87pn371bkc.fsf@cbaines.net
Vincent Legoll <vincent.legoll@gmail.com> writes:

Toggle quote (16 lines)
> On 14/04/2020 00:22, Vincent Legoll wrote:
>> Hello,
>>
>>
>> as I recently worked on the same subject in [1],
>>
>> I reviewed and amended the documentation patch [2].
>>
>>
>> [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40601
>>
>> [2] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=37624
>>
>
> And now with the patch...

I've had a look at the patch, it seems OK. Did you consider adding the
config file to Guix itself, so that a user can copy it, just like the
systemd and upstart examples?

That might be more consistent, and avoid the docs getting longer.

Chris
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl/csDNfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XeJfw//Z0fN20WtCVM/ojB8U7kT+3ZxgjVhll/x
vhR6yB/z8GdnGtOq0w5jQ1gY+5yJzQVSb3SfhC73joMByVSxWJ8FAeoQfXc6J96n
rTRJzSU+bOi2mluG3UaobTkH9i4fi+GJcE/2xYW0z3tJLbF3i6Oe6F7PwrwN5Bip
aZ234n9RRcnhNZithjDCz0ynHuBafqoC5VmFREDG800fTti80ZLDYUKJxABnwmVr
WtV0g9P+iRmW4VfapgDSpVB2GQ7qQZKNb3O98+LH59DHb35YHPrUz5sXrNsG2So0
jV4lO57r/A9hfx/jtAZBlfRubtI3dM9DyF3uXVh9HOrtcG1WjyDKkne8EWVM8ScZ
tlyN8W8CddF4gPnsiiiCx6VUlCYHLGVB4mK2PT5jC02Z+pjbZnlOlpO1RwC72Nbz
XmA4U/VrYEsQEysvt9jxOUy9Pp45Ep2NTIcGykdk4brEiYu8toowsS72qWL3C4Au
KcDK/VtD6hG90Nyuxsl/WsWN/sb/qZCLpI+2WfFhZhyk044QSVErqPa4YlXsb5s6
q5XJ00uPtUgfG0m9ME7JbERG3s8o11BfH76ItBRXxN1MZh/PIZbSgCdLFEigwzLU
2cBfGZaV5Lr8Op0HhQR8v2N3pkB+tlgkgUuqwmtQge8mTEILxNgkMpVI5F8A11S2
JHBiuZ9oeI8=
=nCbb
-----END PGP SIGNATURE-----

V
V
Vincent Legoll wrote on 18 Dec 2020 20:37
(name . Christopher Baines)(address . mail@cbaines.net)
CAEwRq=qzjnYeR5dWfjEyNBugYspK+pUupZi_G2s7LJF0FPJ+kQ@mail.gmail.com
Hello again,

Toggle quote (4 lines)
> I've had a look at the patch, it seems OK. Did you consider adding the
> config file to Guix itself, so that a user can copy it, just like the
> systemd and upstart examples?

Yes, I think I have that done also, I'll dig it out. I even think I saw the
doc issue bug after having done the config file thing.

Toggle quote (2 lines)
> That might be more consistent, and avoid the docs getting longer.

Stay tuned

--
Vincent Legoll
?