From patchwork Thu Feb 3 20:55:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danny Milosavljevic X-Patchwork-Id: 36962 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 CA7A227BBEA; Thu, 3 Feb 2022 21:09:15 +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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 81B5727BBE9 for ; Thu, 3 Feb 2022 21:09:15 +0000 (GMT) Received: from localhost ([::1]:34298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nFjLu-0001us-M1 for patchwork@mira.cbaines.net; Thu, 03 Feb 2022 16:09:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44908) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nFj9T-00036G-J1 for guix-patches@gnu.org; Thu, 03 Feb 2022 15:56:27 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35934) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nFj99-000161-Bi for guix-patches@gnu.org; Thu, 03 Feb 2022 15:56:19 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nFj99-0002h0-Bt for guix-patches@gnu.org; Thu, 03 Feb 2022 15:56:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53763] [PATCH 1/3] services: agetty: Add shepherd-requirement. Resent-From: dannym@scratchpost.org Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Feb 2022 20:56:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53763 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53763@debbugs.gnu.org Cc: Danny Milosavljevic Received: via spool by 53763-submit@debbugs.gnu.org id=B53763.164392174110297 (code B ref 53763); Thu, 03 Feb 2022 20:56:03 +0000 Received: (at 53763) by debbugs.gnu.org; 3 Feb 2022 20:55:41 +0000 Received: from localhost ([127.0.0.1]:58061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFj8n-0002g1-04 for submit@debbugs.gnu.org; Thu, 03 Feb 2022 15:55:41 -0500 Received: from dd30410.kasserver.com ([85.13.145.193]:38786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFj8c-0002f6-83 for 53763@debbugs.gnu.org; Thu, 03 Feb 2022 15:55:39 -0500 Received: from dayas.lan (84-115-234-128.cable.dynamic.surfer.at [84.115.234.128]) by dd30410.kasserver.com (Postfix) with ESMTPSA id 9E2C111202F7; Thu, 3 Feb 2022 21:55:28 +0100 (CET) From: dannym@scratchpost.org Date: Thu, 3 Feb 2022 21:55:19 +0100 Message-Id: <20220203205521.25145-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220203205243.25095-1-dannym@scratchpost.org> References: <20220203205243.25095-1-dannym@scratchpost.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 From: Danny Milosavljevic * gnu/services/base.scm (): Add shepherd-requirement. * doc/guix.texi (agetty-configuration): Document it. --- doc/guix.texi | 4 ++++ gnu/services/base.scm | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index aaa7cbb66f..68c4c4086a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -16634,6 +16634,10 @@ This option accepts, as an integer, the nice value with which to run the This option provides an ``escape hatch'' for the user to provide arbitrary command-line arguments to @command{agetty} as a list of strings. +@item @code{shepherd-requirement} (default: @code{'()}) +The option can be used to provides extra shepherd requirements (for example +@code{'syslogd}) to the respective @code{'term-}* shepherd service. + @end table @end deftp diff --git a/gnu/services/base.scm b/gnu/services/base.scm index fbd01e84d6..d6f584abdb 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -876,6 +876,8 @@ (define-record-type* ;; "Escape hatch" for passing arbitrary command-line arguments. (extra-options agetty-extra-options ;list of strings (default '())) + (shepherd-requirement agetty-shepherd-requirement ;list of SHEPHERD requirements + (default '())) ;;; XXX Unimplemented for now! ;;; (issue-file agetty-issue-file ;file-like ;;; (default #f)) @@ -924,7 +926,8 @@ (define agetty-shepherd-service host no-issue? init-string no-clear? local-line extract-baud? skip-login? no-newline? login-options chroot hangup? keep-baud? timeout detect-case? wait-cr? no-hints? no-hostname? long-hostname? - erase-characters kill-characters chdir delay nice extra-options) + erase-characters kill-characters chdir delay nice extra-options + shepherd-requirement) (list (shepherd-service (documentation "Run agetty on a tty.") @@ -934,7 +937,8 @@ (define agetty-shepherd-service ;; service to be done. Also wait for udev essentially so that the tty ;; text is not lost in the middle of kernel messages (see also ;; mingetty-shepherd-service). - (requirement '(user-processes host-name udev)) + (requirement (cons* 'user-processes 'host-name 'udev + shepherd-requirement)) (modules '((ice-9 match) (gnu build linux-boot))) (start