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 ms11 with LMTPS id 6HAUCw42W2CAGAAA0tVLHw (envelope-from ) for ; Wed, 24 Mar 2021 12:52:30 +0000 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 wLDdBg42W2AoBgAAbx9fmQ (envelope-from ) for ; Wed, 24 Mar 2021 12:52:30 +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 A86E910C3D for ; Wed, 24 Mar 2021 13:52:29 +0100 (CET) Received: from localhost ([::1]:55430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP2zs-0007ta-KW for larch@yhetil.org; Wed, 24 Mar 2021 08:52:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP2zS-0007pZ-QL for guix-patches@gnu.org; Wed, 24 Mar 2021 08:52:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50912) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lP2zS-0007lF-Dy for guix-patches@gnu.org; Wed, 24 Mar 2021 08:52:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lP2zS-0004V7-BL for guix-patches@gnu.org; Wed, 24 Mar 2021 08:52:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47013] (no subject) References: <7072c80a192f3c136cb70da4a0662d77ce508b56.1615236603.git.leo@famulari.name> In-Reply-To: <7072c80a192f3c136cb70da4a0662d77ce508b56.1615236603.git.leo@famulari.name> Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 24 Mar 2021 12:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47013 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47013@debbugs.gnu.org Received: via spool by 47013-submit@debbugs.gnu.org id=B47013.161659030017231 (code B ref 47013); Wed, 24 Mar 2021 12:52:02 +0000 Received: (at 47013) by debbugs.gnu.org; 24 Mar 2021 12:51:40 +0000 Received: from localhost ([127.0.0.1]:34216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lP2z5-0004Tq-OB for submit@debbugs.gnu.org; Wed, 24 Mar 2021 08:51:40 -0400 Received: from mail-wr1-f45.google.com ([209.85.221.45]:47044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lOxnq-0004ZX-6a for 47013@debbugs.gnu.org; Wed, 24 Mar 2021 03:19:45 -0400 Received: by mail-wr1-f45.google.com with SMTP id v4so23315832wrp.13 for <47013@debbugs.gnu.org>; Wed, 24 Mar 2021 00:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muradm-net.20150623.gappssmtp.com; s=20150623; h=user-agent:from:to:date:message-id:mime-version; bh=hegaJRWGesbaMJRMyAtFHjuasMNlHu6/fTOF4sxOmoc=; b=hqQeX/R+mo49xoZEDGiPIdtz9fbrgf4SL4g6wInhI8BI60cXum1CvAmYiXCMB5WqzM t9vS7MFsbWs7Dbqjdkx4ad+TUPL/AIcSLxkzh1aNZHj27jBLDNjbZquvpI17DXCM2DEP fRz75BvnSc72qpY+Jv+J6vpfyBw6q12buwf7E1LbvVG3qaSpM3dQXLPxXMQPkG5aGsr/ ZLRLq0/S5zYmKZhAiLPE7GLcLfLlZd815NFHxr6lN9hmwsh6FWcVQiqpKQ+d/uiDrQba rbkvkuxlLhgZDqafT0hmUhuPL+VAc6xQ7WsQwmf3tXOJBfxzMTtvRlrZ+ptTjvv8IIdE oRkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:date:message-id:mime-version; bh=hegaJRWGesbaMJRMyAtFHjuasMNlHu6/fTOF4sxOmoc=; b=msWgWNTsYGCAHpjzpkg1n2/RxvsPbVNDlT2bHM73bf47b2VCn5qAItqXEISZtmpaOs bx3nk46XkVxtsZQ3LjHNrfIY85TD1qQWORwQqiACRreJrnxDFPWmIBJCYNOpf/qCMnuR wToIOWfZx2bfS71KLvyLeV1l5xz7rPnNj7J26qjp8Ocm6qprros9AXzKhYO5goylKch+ tnQC5DQ4a8+9lax+CFsQQn+c39a6AroTRn5nx7MFRjQkZrQQX5/h/tDcPte9jRxIlcwd nOWnbMmcdXcLNTjc1EgnxSUepOIej23PdYW5tGMnryWOUNU24T4iXNRDGKoOXniCJUgk 7+sw== X-Gm-Message-State: AOAM532r3PizM46eIqZBp69cG+7SGdgNzzvPCRvvMuUL9NMoy6SRczMH xcfMDoPn4H/Smueig5rsg7r/5mHj0t7sEd06 X-Google-Smtp-Source: ABdhPJy+vZOpMdCVwn9TZBNmSXDL6L56XyJZpCrJze22JZz89KkV9QyZWEg2rLAN1OXGDJd8dpfn9g== X-Received: by 2002:adf:f005:: with SMTP id j5mr1797171wro.423.1616570375977; Wed, 24 Mar 2021 00:19:35 -0700 (PDT) Received: from nomad-gx1 ([217.131.81.96]) by smtp.gmail.com with ESMTPSA id e17sm1976799wra.65.2021.03.24.00.19.34 for <47013@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 00:19:35 -0700 (PDT) User-agent: mu4e 1.4.15; emacs 27.1 From: muradm Date: Wed, 24 Mar 2021 10:19:29 +0300 Message-ID: <878s6dnhmm.fsf@muradm.net> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Mailman-Approved-At: Wed, 24 Mar 2021 08:51:39 -0400 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1616590349; 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=hegaJRWGesbaMJRMyAtFHjuasMNlHu6/fTOF4sxOmoc=; b=e6w8UBqEj0nt7M1JHqmNgd6+OBi1LJOxYliO1qdsIizvaKBQk9udp0lt86ZhczA78iqvF8 +/qARr8ysQa8wNGJvSwMkt1ip+wogKZtwX1NBiN4vj+SpDjJY78+Qx97p7SQbMD8QfBZQx 0xGWiNCoowIeqwrYSXee9yjceCxJI3gpHdyQUt49sTaLKjNzRr6sb3oC57bEPe+TGy0tbe ZOzgDjAEK5TT8nbLXDVaOt6j3hxq9MjX3Gq3a35bRcYFaKBiXTd5Hb5sR7acy4y4Sp+Xvy u5+pbVxg45NWXGPXntV9AOyWYWP9aq9CoQU1AKLUQFR/62Mbc+Hx1zYZmRnhRA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1616590349; a=rsa-sha256; cv=none; b=qw2TuqxUCmt1aOSr6kKb0kkuXpld/aJnZ17hsP4V131TWWjIc3oiNeyRQdg9l6GFj3I/ux amwriRkw5J0B4gv77QtepTSwQv2qcs6H6JBKHtRTYyM6w6LojkwObycd/bb8ooyhWIjci+ sDMgXHzSPSSKD3T4bPVikiBlYMb0XQb3Qb1GUdDc/pN4w4SB3qcolCL3rznkcuK/uBoNGx WgOxbl+kevWhAKVHEIEBcdfEvI4E6oHxK3zLk8VYqX0g1cqeaDgkRL+rjgUj93Xwo0bx6K 1EwlQVfmLc6oMSQR+4lu+Np6s7IftlFjSvh6AhaFmr2OtoL3afZD2CQYOftivg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=muradm-net.20150623.gappssmtp.com header.s=20150623 header.b="hqQeX/R+"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.62 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=muradm-net.20150623.gappssmtp.com header.s=20150623 header.b="hqQeX/R+"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: A86E910C3D X-Spam-Score: -2.62 X-Migadu-Scanner: scn0.migadu.com X-TUID: U6tZaunHNG5v There is a need to have important sysctl settings fs.protected_hardlinks and fs.protected_symlinks for all installations of Guix in the world unless explicitly stated otherwise. Currently in Linux kernel they are unset by default. It is also stated that other distributions do the same. In perfect world I would go for Solution 1 below, as it is most effectful, and clean. Solution 1: From this statement, it seems that the first resort whould be Linux kernel it self. If it would be possible to configure them with Kconfig, that would be best place. As of my brief look at linux/fs, they are not configurable, but may be I miss somthing. Any way preferred solution would be just compile kernel with protected hardlinks and symlinks set to 1. Since other distributions do the same, it could be reasonable to expose these two settings via Kconfig, and solve it there. - pros: great for the world - cons: have to do enhancement in mainline Linux Solution 2: If it is not possible to have these two settings in kernel as per Solution 1, Guix may maintain a patch to kernel that would do this. - pros: no need to enhance mainline Linux - cons: will impact users who do use Guix and compile Linux kernel them selves Solution 3: Handle in Guix configuration. Everything below related to solution 3. Currently it is set as folowing: ;; gnu/services/sysctl.scm (define-module .... #:export (.... %default-sysctl-settings) (define %default-sysctl-settings ;; Default kernel parameters enabled with sysctl. '(("fs.protected_hardlinks" . "1") ("fs.protected_symlinks" . "1"))) (define-record-type* sysctl-configuration make-sysctl-configuration sysctl-configuration? (sysctl sysctl-configuration-sysctl ; path of the 'sysctl' command (default (file-append procps "/sbin/sysctl"))) (settings sysctl-configuration-settings ; alist of string pairs (default %default-sysctl-settings))) ;; ends- gnu/services/sysctl.scm And sysctl-service-type it self is added to the %base-services. Since sysctl-configuration-settings function to access settings field of sysctl-configuration instance is not exported, I have to do the following in my configuration: (define nomad-gx1-os (operating-system (inherit my-base-nomad-os) ;; important line-#1 ... (services (modify-services my-base-nomad-services (sysctl-service-type config => (inherit config) (settings (append %default-sysctl-settings ;; from gnu/services/sysctl.scm '(("fs.inotify.max_user_watches" . "524288") ("fs.inotify.max_user_instances" . "16384") ("fs.inotify.max_queued_events" . "65536"))))))))) This is fine, until I extend sysctl-service-type in my-base-nomad-os. Then I have to export my-base-nomad-sysctl-settings and join them with %default-sysctl-settings and extra settings for nomad-gx1-os. While it is bearable for one or two levels of inheritance, it becomes hard to keep track for more levels and/or many hosts. If sysctl-configuration-settings would be exported as per #47323, then my configuration would become simplier: (services (modify-services my-base-nomad-services (sysctl-service-type config => (inherit config) (settings (append (sysctl-configuration-settings config) ;; now I can't do this '(("fs.inotify.max_user_watches" . "524288") ("fs.inotify.max_user_instances" . "16384") ("fs.inotify.max_queued_events" . "65536"))))))))) In this case, if Guix documentation will include sysctl-configuration-settings, then most likely people won't forget use %default-sysctl-settings, and it is still possible to override them if one desires not to use protected symlinks and hardlinks.