From patchwork Sat Jan 22 10:24:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AwesomeAdam54321 X-Patchwork-Id: 36747 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 04ED927BBEA; Sat, 22 Jan 2022 13:42:58 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7E49D27BBE9 for ; Sat, 22 Jan 2022 13:42:57 +0000 (GMT) Received: from localhost ([::1]:39354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nBGfQ-00074A-MR for patchwork@mira.cbaines.net; Sat, 22 Jan 2022 08:42:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBEZq-0001xU-Bc for guix-patches@gnu.org; Sat, 22 Jan 2022 06:29:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42931) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nBEZp-0006iM-Uu for guix-patches@gnu.org; Sat, 22 Jan 2022 06:29:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nBEZp-0006qR-ND for guix-patches@gnu.org; Sat, 22 Jan 2022 06:29:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53441] [PATCH] Add service examples to the GNU Shepherd manual Resent-From: AwesomeAdam54321 Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Jan 2022 11:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53441 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53441@debbugs.gnu.org Cc: AwesomeAdam54321 X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164285090226247 (code B ref -1); Sat, 22 Jan 2022 11:29:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 Jan 2022 11:28:22 +0000 Received: from localhost ([127.0.0.1]:35831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBEZC-0006pH-Aw for submit@debbugs.gnu.org; Sat, 22 Jan 2022 06:28:22 -0500 Received: from lists.gnu.org ([209.51.188.17]:54202) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBDhJ-0005F8-88 for submit@debbugs.gnu.org; Sat, 22 Jan 2022 05:32:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBDhJ-0002S1-03 for guix-patches@gnu.org; Sat, 22 Jan 2022 05:32:41 -0500 Received: from [2a00:1450:4864:20::134] (port=45795 helo=mail-lf1-x134.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nBDhH-0003oC-5U for guix-patches@gnu.org; Sat, 22 Jan 2022 05:32:40 -0500 Received: by mail-lf1-x134.google.com with SMTP id o12so38977075lfu.12 for ; Sat, 22 Jan 2022 02:32:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wWCkOgE7qiCoMb8PNIBuw+oJTMrbZfcu6DcpaNw+U/Q=; b=PLTkMtSQn1Jiyr9vulsVhHWmOXN8zrOPg8PTS1CBfZW5ZjWeK6lYD9KjZx1bEoU0pj JoYFmwX9mOmX1KcnkTt7jkm1j7V9RoDxh/4sNNQ1IZUpRYFvd/JxsYSmT1MhPT/ySuuC AU2/ii3YoJ4qqxvB5kgh61PBWFp1c81r0pV17iwGx051DZ0zf8ldjBEdbtBN69W9RVfn loYPB5Cb4YOJoHg3U+QhUNfl9bK1k7gbZEGWC6nhg+Y1Giil4VvKZdCIGESix8wj65pu uQQ1srnDXA//8qTFC8zKIJFq+ScqoPr8/bxHH7tLr8ClLJAal9WpSNS+WRoy74TH+xdl w7cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wWCkOgE7qiCoMb8PNIBuw+oJTMrbZfcu6DcpaNw+U/Q=; b=fM+o+bC/HJaw+RFju1+ifAzg/PjHj3mdkwzXoZ4gdrvAsglzQKgabnTWmcAhhzbjni e/6KpLlr6PB7ClGnxAQrz9h+WKb4maTeTOgixkhfMAUCE0u5ngtu2hOVNJnk4W/Dpach sWG0EDl85cxxErvzZJlEW2vf73arvwlx/Nv2XZbWMMAxZ8WHrqn2gQCXl61Ie6S/NhMI JJk8l2XE+Dd1jzbRJRuTE3v9t79e1Ro0QDnjpA9xyCtxyzc4ruR+oIrozDoZgn2C127E E/xZ9s497Qu98rqaqBlqS3KkeaubWQShljCj+hG78I5Vq1TVG1Xka0YLtW9fO1gsguh2 vneQ== X-Gm-Message-State: AOAM530epBpCL3yAS/AEDVldleXlaa2gNsbDbo1hiklRfFaDoMafZGCA FISNJGMSzEF3X2xHn8tZdNPKGXv2+97PJSYS X-Google-Smtp-Source: ABdhPJzjQGdg08qI88Qe5r8FlGjxsfqYopEpp35kWkpeBZPWIqSxhpf3uIQY2K+UpkVEH2lPRIIF5w== X-Received: by 2002:a17:907:94c1:: with SMTP id dn1mr6086028ejc.251.1642847144764; Sat, 22 Jan 2022 02:25:44 -0800 (PST) Received: from localhost.localdomain ([60.51.145.32]) by smtp.gmail.com with ESMTPSA id s9sm3537776edj.48.2022.01.22.02.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jan 2022 02:25:44 -0800 (PST) From: AwesomeAdam54321 Date: Sat, 22 Jan 2022 18:24:16 +0800 Message-Id: <98d6b3ce5ebbc019175145751371c5bf0946a308.1642847055.git.adam.faiz5990@gmail.com> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::134 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=adam.faiz5990@gmail.com; helo=mail-lf1-x134.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 22 Jan 2022 06:28:21 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sat, 22 Jan 2022 08:15:33 -0500 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches --- doc/shepherd.texi | 62 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) 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 + #:provides '(cups) + #:requires '() + #:docstring "The cups service provides the CUPS scheduler." + #:start (make-forkexec-constructor '("cupsd" "-f")) + #:stop (make-kill-destructor) + #:respawn? #t) + + (make + #: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 + #: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 + #: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 + #: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 + #:provides '(lm-sensors) + #:requires '() + #:docstring "Initialize hardware monitoring sensors." + #:start (make-system-constructor "sensors -s ; sensors") + #:stop (make-system-destructor) + #:oneshot? #t) + + (make + #: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