From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +BuGM7Y4DGGcWQEAgWs5BA (envelope-from ) for ; Thu, 05 Aug 2021 21:15:02 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cC0GL7Y4DGE5DAAAbx9fmQ (envelope-from ) for ; Thu, 05 Aug 2021 19:15:02 +0000 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 E2F73A141 for ; Thu, 5 Aug 2021 21:15:01 +0200 (CEST) Received: from localhost ([::1]:36918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBipY-0007rQ-JW for larch@yhetil.org; Thu, 05 Aug 2021 15:15:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBioc-0006yW-RR for bug-guix@gnu.org; Thu, 05 Aug 2021 15:14:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mBioc-00045Z-Ak for bug-guix@gnu.org; Thu, 05 Aug 2021 15:14:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mBiob-0002bw-QU for bug-guix@gnu.org; Thu, 05 Aug 2021 15:14:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#40158: mount point is not created if mount? is #f Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 05 Aug 2021 19:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40158 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 40158@debbugs.gnu.org Received: via spool by 40158-submit@debbugs.gnu.org id=B40158.162819083010011 (code B ref 40158); Thu, 05 Aug 2021 19:14:01 +0000 Received: (at 40158) by debbugs.gnu.org; 5 Aug 2021 19:13:50 +0000 Received: from localhost ([127.0.0.1]:48475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBioQ-0002bP-6K for submit@debbugs.gnu.org; Thu, 05 Aug 2021 15:13:50 -0400 Received: from mail-qk1-f172.google.com ([209.85.222.172]:33469) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBioO-0002bB-3b for 40158@debbugs.gnu.org; Thu, 05 Aug 2021 15:13:49 -0400 Received: by mail-qk1-f172.google.com with SMTP id t66so7480968qkb.0 for <40158@debbugs.gnu.org>; Thu, 05 Aug 2021 12:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=ZRs6ahV1fxRlYzdAzd47bh3Ttcxu5y2/VIU89V494go=; b=eaGlE0uBFThdZ2Vju529U/V02uFOWMiMX4ZbE3bq3BWyrIoGY+ETphx8I8BUWswqol SxO9lDfVZDLgdQ2f/X1sGjiU0YcbrDcDgfciiBexR4REQ0HngjXns+YVoiquTN/mOwsw xJ1jUnk6MiLQRaTYHXLbpMS17lWlFkcWq/EECIi7vpp30GX+pdvPEMqZldGtMyWMd7QW AQrK+n/Z9cSM88uklV2vF1fBjZ+JZyKEkA6b0CQfr9EiH09G14LbMQrs6N801oDBTh+A WKOJtLtu+0OruuQpqyhZBj/PfwYw21nMUMhi1LK81yPEmY7dhFJuhLSZD+WqinpzK9sf F6Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ZRs6ahV1fxRlYzdAzd47bh3Ttcxu5y2/VIU89V494go=; b=B8ZVtvh1uorOrqG5YW8BKYI5ux81bB1bQUvbd4SHfhzbXz9XeMDpao43r8r8llTS5L ZGdbxrYdM+bSs4gWnaAP1VsbrQnWJK4A8UhMLb3qovXvDDtNRbObBtMjycs2HewBi9Io PJ07mg5RaROst/qfHwdk80BS8NqUnjvrlHoVkQs4FxL0v5yVQ73rRwH2YtGPRcuiTJ1v Pr1eX7NFwJjoHFItuqk9bCHBGw2lh53IPl1PHEhLZ563YkVBabt1neeZqPHRrTqsZoGq GRNthDyxPHSDsWi08RrAcYQGVMAiE6PRnmQpYHS3cGTOIqqJdYeCmiqKlklzTXFkY5e0 R0bQ== X-Gm-Message-State: AOAM531kRCQxCiSwFvmiEc9I+ZlwK+W8fELzqEpq0BKrQDjGvwNCDEAy 0cyfL+sVRzIXx2At06+iY38XPfbITuqNqJ/i X-Google-Smtp-Source: ABdhPJzcAS+GIIa7pVG6fBMeim0cJ4e62otiPsmxn7XErMJrpOC53d4Pl5jxGLe6awcRVW2v2svfSg== X-Received: by 2002:a37:2708:: with SMTP id n8mr6368679qkn.228.1628190822430; Thu, 05 Aug 2021 12:13:42 -0700 (PDT) Received: from raisin ([2607:fad8:4:6:235e:8579:8464:aacc]) by smtp.gmail.com with ESMTPSA id g11sm2493719qtk.91.2021.08.05.12.13.41 for <40158@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Aug 2021 12:13:41 -0700 (PDT) From: Maxim Cournoyer References: <87tv2i1uxr.fsf@raisin.i-did-not-set--mail-host-address--so-tickle-me> Date: Thu, 05 Aug 2021 15:13:41 -0400 In-Reply-To: <87tv2i1uxr.fsf@raisin.i-did-not-set--mail-host-address--so-tickle-me> (maxim cournoyer's message of "Fri, 20 Mar 2020 19:13:36 -0400") Message-ID: <87o8ab7li2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628190902; 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:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=ZRs6ahV1fxRlYzdAzd47bh3Ttcxu5y2/VIU89V494go=; b=rMvUikwTNaI3lxWK2lAYTnNNkCPyazNdRZ5tGawJPBbyHIArwk+LtHTpT32CIMfUg7+fP6 cjsHy0ElN74X0bPbGNnicuk5umweCRG+jm3Sv3gPbOKQ2BcFH/Vie8lJ1lReyCTLRRb2Pw w6UlJPDTl0xJJGasKwrcbWyqxu7TpGkvvWrrvQ62qh9cEhtYOfUxsVqVJCTusiNL493ktf x2AzD75mMsUiqcMq5Z/P1O5MSYwN/V/AKfcQDHhHKgHS+958EpCz6YWOGC2ZlBjH+IDULX UwD/aXahYQWVmq9sT3r9kYaWo+KBkxkOK9IDw1J5IJ+oxce7TL9xogtb1Jfr3g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628190902; a=rsa-sha256; cv=none; b=Cw64wyhgbfQbojAqZpMrJ9Cpe9U98d3t2ByJi8FOAyWpTCE69JsjNRYko5RHLg8SP9/DJp FFZg/f9gpxpRV34uK2Ksfj1XxknWpmPCb6Grcu/hec/Ya5Fg1OWUk6hCv+Dp8kMv8C5CwJ fT5unZLRvO0OVsig+ipWT7Wd73AThU/RTEd/DZab6Hv4aDxlC5aT+KhqkvZ4ayPaCgtJz0 mjv7PtmsW12g5HGMhcLSKOrEFRHEnWRsMgd8bPw++j0FnxVd4wrgvSn4O7vtxA11gKtxe/ kJXNCfArnuDu5YKWynMhCqv+PbPGgRmgNQ1OfaVjICL/KSIO3t7dLm7JXd7AQQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=eaGlE0uB; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -1.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=eaGlE0uB; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: E2F73A141 X-Spam-Score: -1.32 X-Migadu-Scanner: scn1.migadu.com X-TUID: LDo/I4h5/3PQ --=-=-= Content-Type: text/plain Hello, maxim.cournoyer@gmail.com writes: > Consider the following file system record: > > (file-system > (device "some-server:/mnt/scratch/yocto-sstate")" > (mount-point "/mnt/scratch/yocto-sstate") > (create-mount-point? #t) > (type "nfs") > (mount? #f) > (options "soft") > (flags '(no-exec))) > > Even though a user would think the mount point would be created, it is > not, I'm guessing because mount? is #f. > > Maxim I had the "chance" again today to meet this issue, so I took it by the horns and came up with the attached patch, which fixes it: --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-services-base-Honor-file-system-create-mount-point-a.patch Content-Transfer-Encoding: quoted-printable >From 5f9585e5fd74e192cab8a1e4e3c025cf217f26d3 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Thu, 5 Aug 2021 14:16:50 -0400 Subject: [PATCH] services: base: Honor file-system-create-mount-point? at a= ll times. Fixes . * gnu/services/base.scm (file-system-shepherd-service): Update doc. Return= a shepherd service for the mount point when either MOUNT? or CREATE? is true. [start]: Only mount when MOUNT? is true. (file-system-shepherd-services): Also consider file systems with create-mount-point? set to #t. --- gnu/services/base.scm | 53 +++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/gnu/services/base.scm b/gnu/services/base.scm index e206bea5f0..6791dff101 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -15,6 +15,7 @@ ;;; Copyright =C2=A9 2020, 2021 Brice Waegeneire ;;; Copyright =C2=A9 2021 qblade ;;; Copyright =C2=A9 2021 Hui Lu +;;; Copyright =C2=A9 2021 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -311,17 +312,20 @@ FILE-SYSTEM." =20 (define (file-system-shepherd-service file-system) "Return the shepherd service for @var{file-system}, or @code{#f} if -@var{file-system} is not auto-mounted upon boot." +@var{file-system} is not auto-mounted or doesn't have its mount point crea= ted +upon boot." (let ((target (file-system-mount-point file-system)) (create? (file-system-create-mount-point? file-system)) + (mount? (file-system-mount? file-system)) (dependencies (file-system-dependencies file-system)) (packages (file-system-packages (list file-system)))) - (and (file-system-mount? file-system) + (and (or mount? create?) (with-imported-modules (source-module-closure '((gnu build file-systems))) (shepherd-service (provision (list (file-system->shepherd-service-name file-syst= em))) - (requirement `(root-file-system udev + (requirement `(root-file-system + udev ,@(map dependency->shepherd-service-name depend= encies))) (documentation "Check, mount, and unmount the given file syste= m.") (start #~(lambda args @@ -329,24 +333,26 @@ FILE-SYSTEM." #~(mkdir-p #$target) #t) =20 - (let (($PATH (getenv "PATH"))) - ;; Make sure fsck.ext2 & co. can be found. - (dynamic-wind - (lambda () - ;; Don=E2=80=99t display the PATH settings. - (with-output-to-port (%make-void-port "w") - (lambda () - (set-path-environment-variable "PATH" - '("bin" "s= bin") - '#$package= s)))) - (lambda () - (mount-file-system - (spec->file-system - '#$(file-system->spec file-system)) - #:root "/")) - (lambda () - (setenv "PATH" $PATH))) - #t))) + #$(if mount? + #~(let (($PATH (getenv "PATH"))) + ;; Make sure fsck.ext2 & co. can be found. + (dynamic-wind + (lambda () + ;; Don=E2=80=99t display the PATH set= tings. + (with-output-to-port (%make-void-port= "w") + (lambda () + (set-path-environment-variable "P= ATH" + '(= "bin" "sbin") + '#= $packages)))) + (lambda () + (mount-file-system + (spec->file-system + '#$(file-system->spec file-system)) + #:root "/")) + (lambda () + (setenv "PATH" $PATH)))) + #t) + #t)) (stop #~(lambda args ;; Normally there are no processes left at this poin= t, so ;; TARGET can be safely unmounted. @@ -365,7 +371,10 @@ FILE-SYSTEM." =20 (define (file-system-shepherd-services file-systems) "Return the list of Shepherd services for FILE-SYSTEMS." - (let* ((file-systems (filter file-system-mount? file-systems))) + (let* ((file-systems (filter (lambda (x) + (or (file-system-mount? x) + (file-system-create-mount-point? x))) + file-systems))) (define sink (shepherd-service (provision '(file-systems)) --=20 2.32.0 --=-=-= Content-Type: text/plain Thanks, Maxim --=-=-=--