From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sETIAQu4umOcRQAAbAwnHQ (envelope-from ) for ; Sun, 08 Jan 2023 13:33:15 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id kE7jAQu4umNO6gAA9RJhRA (envelope-from ) for ; Sun, 08 Jan 2023 13:33:15 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BF5FB396D7 for ; Sun, 8 Jan 2023 13:33:14 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEUqu-0002Fx-HF; Sun, 08 Jan 2023 07:32:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEUqb-00026j-O4 for bug-guix@gnu.org; Sun, 08 Jan 2023 07:32:25 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEUqJ-0006NN-1A for bug-guix@gnu.org; Sun, 08 Jan 2023 07:32:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pEUqI-0000wl-DI for bug-guix@gnu.org; Sun, 08 Jan 2023 07:32:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#60657: Rethinking how service extensions work Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 08 Jan 2023 12:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60657 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 60657@debbugs.gnu.org X-Debbugs-Original-To: bug-guix Received: via spool by submit@debbugs.gnu.org id=B.16731810783564 (code B ref -1); Sun, 08 Jan 2023 12:32:02 +0000 Received: (at submit) by debbugs.gnu.org; 8 Jan 2023 12:31:18 +0000 Received: from localhost ([127.0.0.1]:60131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEUpZ-0000vP-U9 for submit@debbugs.gnu.org; Sun, 08 Jan 2023 07:31:18 -0500 Received: from lists.gnu.org ([209.51.188.17]:45276) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEUpU-0000vE-NJ for submit@debbugs.gnu.org; Sun, 08 Jan 2023 07:31:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEUpT-0001xO-Ju for bug-guix@gnu.org; Sun, 08 Jan 2023 07:31:11 -0500 Received: from smtpmciv6.myservices.hosting ([185.26.106.201]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pEUpR-0006Ab-CO for bug-guix@gnu.org; Sun, 08 Jan 2023 07:31:11 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpmciv6.myservices.hosting (Postfix) with ESMTP id E679C20682 for ; Sun, 8 Jan 2023 13:31:05 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id A007F80096 for ; Sun, 8 Jan 2023 13:31:05 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 8FpZXsycBF_I for ; Sun, 8 Jan 2023 13:31:04 +0100 (CET) Received: from [192.168.1.239] (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 4CF6580093 for ; Sun, 8 Jan 2023 13:31:04 +0100 (CET) Message-ID: Date: Sun, 8 Jan 2023 12:31:03 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US From: Bruno Victal Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=185.26.106.201; envelope-from=mirai@makinata.eu; helo=smtpmciv6.myservices.hosting X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1673181194; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jjCkCp06FXy/HLvb0lPM7pqmxNjp7h4Sh3LeWuH4+7g=; b=B/aYFLL3qN1pMAY280SiAcgeg+Y0aKw+zkYT+Ki6XjBcF091Fzw6KxrEi0uIImH9FqTp9h UAGZXO1gNc6KTAeHr7LtRWw2GA4yRUMP2eB6hIBrbHPryH2VzK03y0JOb8FwNTkQhlZu8s ApfAHu+TPniYlbP1jBdXcsiiUvw0vUA+mtye7+6zEpk6X1qT5L1kdyyQrn2v+izDXGVMg0 o8ZzhXabP79R8ijd2KxY0hvsZYv8xSuejz4Xt6X8CgpySiR3C5nN/D5Gze2Gl/dOCuuWdw /q2s21Ua5CHxhXqo6E34lmsoKz0tVZnskntgAkZEBbmpU4mcxOoAjRJVBxrs7g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1673181194; a=rsa-sha256; cv=none; b=Kmgo2IpSl1Y7Ji6Z+mazmEgg7gIrI7b7XZjhvv+r3MwmKeiovDEBQJ4QwQmqbGIf71sHk4 yF5Ti1tYS8GzK6nGfU4FlOSUOlrSO5Pxxl3JKfiFt21P3VLMmxRzBu1YdyzsAFJxQXYWzq 05lw0vMmZrlIrYfppGTuHGrz9iiYCU33293PwL4ZbCDhBFuVlekMUig3lwUK1d6DWE6vX/ r47oz+6WyPKh4sAIdnJoL61H+EBRW2hcYcSKHO5qvBBgi0zemn532SfSLVdHEMo9mtShcT AXF20ERBFa77fzXWsKYv15P95Bw2MbG9dsB7Tbtp0A8oWuu5qmMVhAimDqauTA== X-Spam-Score: -3.27 X-Migadu-Queue-Id: BF5FB396D7 Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -3.27 X-TUID: q5CjNsy3LX8L Hi all, The current situation with services in Guix is that service extensions do not care about dependencies. This can result in cryptic errors as seen in [1]. In [1], the issue arises from using activation-service-type to create files/directories for services when these should be either (1) shepherd one-shot services or moved into the 'start' procedure of the service. 'activation-service-type' should only be used for doing things "listed on its label", that is, performing actions at boot-time or after a system reconfigure. But both solutions (1) and (2) are still not enough as the directories themselves might not yet be available and the services must be aware of this fact and wait for them to be ready. One example would be a network dependent mount or a simple service that mounts a volume such as: --8<---------------cut here---------------start------------->8--- (simple-service 'mount-overlayfs shepherd-root-service-type (list (shepherd-service (requirement '(foo-mount)) (provision '(overlayfs-foo)) (documentation "Mount OverlayFS.") (one-shot? #t) (start (let ((util-linux (@ (gnu packages linux) util-linux))) #~(lambda _ (system* #$(file-append util-linux "/bin/mount") "-t" "overlay" "-o" (string-append "noatime,nodev,noexec,ro," "lowerdir=" (string-join '("/srv/foo/overlays/top-layer" "/srv/foo/overlays/layer2" "/srv/foo/overlays/layer1" "/media/foo-base") ":")) "none" "/media/foo" ))))))) --8<---------------cut here---------------end--------------->8--- This example also means that it's untenable to just look into the file-systems field entries and attempt to intelligently discover which paths are required for the services and add them as dependencies (another hole to this idea is that overlayfs and some fuse filesystems can mount over the same path). I've proposed in [2] for the service procedure to accept optional arguments, these could be of interest in solving this problem. Another place we should look at is how systemd manages its service dependencies, with the 'Wants', 'After', 'Before', 'RequiresMountsFor', etc. [3] directives. These could potentially be implemented and used alongside [2]. Such changes might also imply that a UI change in herd is required to handle the structured information or to avoid cluttering it with too much "noise". [1]: https://issues.guix.gnu.org/57589#12 [2]: https://lists.gnu.org/archive/html/guix-devel/2022-12/msg00292.html [3]: https://www.freedesktop.org/software/systemd/man/systemd.unit.html#%5BUnit%5D%20Section%20Options