[PATCH] Add service examples to the GNU Shepherd manual

  • Done
  • quality assurance status badge
Details
2 participants
  • AwesomeAdam54321
  • Ludovic Courtès
Owner
unassigned
Submitted by
AwesomeAdam54321
Severity
normal
A
A
AwesomeAdam54321 wrote on 22 Jan 2022 11:24
(address . guix-patches@gnu.org)(name . AwesomeAdam54321)(address . adam.faiz5990@gmail.com)
98d6b3ce5ebbc019175145751371c5bf0946a308.1642847055.git.adam.faiz5990@gmail.com
---
doc/shepherd.texi | 62 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)

Toggle diff (75 lines)
diff --git a/doc/shepherd.texi b/doc/shepherd.texi
index 94f6131..618d852 100644
--- a/doc/shepherd.texi
+++ b/doc/shepherd.texi
@@ -1033,6 +1033,68 @@ also specifies some more initial values for the slots:
(restart (...)))))
@end lisp
+Here are some more examples:
+
+@lisp
+(register-services
+ (make <service>
+ #:provides '(cups)
+ #:requires '()
+ #:docstring "The cups service provides the CUPS scheduler."
+ #:start (make-forkexec-constructor '("cupsd" "-f"))
+ #:stop (make-kill-destructor)
+ #:respawn? #t)
+
+ (make <service>
+ #:provides '(cups-browsed)
+ #:requires '(cups)
+ #:docstring "The cups-browsed service makes remote CUPS printers available locally."
+ #:start (make-forkexec-constructor '("cups-browsed"))
+ #:stop (make-kill-destructor)
+ #:respawn? #t)
+
+ (make <service>
+ #:provides '(cron)
+ #:requires '()
+ #:docstring "The cron service provides execution of regularly scheduled commands."
+ #:start (make-forkexec-constructor '("cron" "-f"))
+ #:stop (make-kill-destructor)
+ #:respawn? #t)
+
+ (make <service>
+ #:provides '(guix-daemon)
+ #:requires '()
+ #:docstring "The guix-daemon service accesses the store, and builds derivations on behalf of its clients."
+ #:start (make-forkexec-constructor '("env" "GUIX_LOCPATH=/var/guix/profiles/per-user/root/guix-profile/lib/locale" "LC_ALL=en_US.utf8" "/var/guix/profiles/per-user/root/current-guix/bin/guix-daemon" "--build-users-group=guixbuild"))
+ #:stop (make-kill-destructor)
+ #:respawn? #t)
+
+ (make <service>
+ #:provides '(binfmt-support)
+ #:requires '()
+ #:docstring "Enables support for additional executable binary formats."
+ #:start (make-forkexec-constructor '("update-binfmts" "--enable"))
+ #:stop (make-system-destructor "update-binfmts --disable")
+ #:oneshot? #t)
+
+ (make <service>
+ #:provides '(lm-sensors)
+ #:requires '()
+ #:docstring "Initialize hardware monitoring sensors."
+ #:start (make-system-constructor "sensors -s ; sensors")
+ #:stop (make-system-destructor)
+ #:oneshot? #t)
+
+ (make <service>
+ #:provides '(pulseaudio)
+ #:requires '()
+ #:docstring "The pulseaudio service provides the PulseAudio Sound Server."
+ #:start (make-forkexec-constructor '("pulseaudio" "--daemonize=no" "--log-target=stderr") #:user "user" #:group "audio" #:environment-variables '("HOME=/home/user"))
+ #:stop (make-kill-destructor)
+ #:respawn? #t))
+
+@end lisp
+
@node Managing User Services
@section Managing User Services
--
2.34.0
L
L
Ludovic Courtès wrote on 2 Jan 23:42 +0100
control message for bug #53441
(address . control@debbugs.gnu.org)
87bka3gxw5.fsf@gnu.org
tags 53441 wontfix
close 53441
quit
?
Your comment

This issue is archived.

To comment on this conversation send an email to 53441@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 53441
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch