Maxime Devos <maximede...@telenet.be> writes:

[…]

>> It would be helpful to have a paragraph in the documentation how to
>> override the Shepherd, and if you know a proper way, please add a small
>> example of operating-system definition with overriden Shepherd and a
>> basic service like OpenSSH.
>
> Yes, would be very helpful, especially as it's easy to get wrong.
> I'm currently occupied with other things, though.  

If you don't mind I could push the following instruction:

From f94a63bb35f6f05bd429703ec3102d15cfb1e382 Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <go.wig...@gmail.com>
Date: Mon, 1 Feb 2021 01:49:00 +0300
Subject: [PATCH] doc: Explain how to set custom Shepherd package.

* doc/guix.texi (Shepherd Services): Give example on how to set custom
Shepherd package.
---
 doc/guix.texi | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index aca4657d6a..76a4e55e50 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -32826,6 +32826,24 @@ mechanism instead (@pxref{Shepherd Services}).
 @end table
 @end deftp
 
+The following example specifies the Shepherd package for operating
+system:
+
+@lisp
+(operating-system
+  ;; ...
+  (services (append (list openssh-service-type))
+            ;; ...
+            %desktop-services)
+  ;; ...
+  ;; Use own Shepherd package.
+  (essential-services
+   (modify-services (operating-system-default-essential-services this-operating-system)
+     (shepherd-root-service-type config => (shepherd-configuration
+					    (inherit config)
+					    (shepherd my-shepherd))))))
+@end lisp
+
 @defvr {Scheme Variable} %shepherd-root-service
 This service represents PID@tie{}1.
 @end defvr
-- 
2.30.0

Attachment: signature.asc
Description: PGP signature

Reply via email to