From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qWBiBzoBSWBZZgAA0tVLHw (envelope-from ) for ; Wed, 10 Mar 2021 17:26:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id MKG9AjoBSWApOAAA1q6Kng (envelope-from ) for ; Wed, 10 Mar 2021 17:26:18 +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 20BB32437E for ; Wed, 10 Mar 2021 18:26:17 +0100 (CET) Received: from localhost ([::1]:53660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lK2bA-0001MM-0D for larch@yhetil.org; Wed, 10 Mar 2021 12:26:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lK2HH-0004YG-8q for help-guix@gnu.org; Wed, 10 Mar 2021 12:05:43 -0500 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:39497) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lK2HE-0008SN-La for help-guix@gnu.org; Wed, 10 Mar 2021 12:05:42 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 9B7F45C0125; Wed, 10 Mar 2021 12:05:39 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 10 Mar 2021 12:05:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=famulari.name; h=date:from:to:subject:message-id:mime-version:content-type :content-transfer-encoding; s=mesmtp; bh=R7NNURfxzYaPgXyW5iM+zso Pt65YNBqxpioRTr/hwnc=; b=ERA6Hwts4wMYH5pxjHNyQ8OnGhSw5qg2BWvWZ29 UCA5tVB3DdyMjLaZ514wc4mf4YT5HdpwS5PAqsLFbOeAMpo5x+/I7qGgG9oh9p8w PT7A5o2b+UPTYlJlqN+Ti7fF3wf9+t28Pbq/t2WwW8EeyjNe4pFz2iQQuO/Zo4qQ wShA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=R7NNUR fxzYaPgXyW5iM+zsoPt65YNBqxpioRTr/hwnc=; b=CYxy1szjdrdN27RkQ4/+JW gCiZ6yBT1q+qQODc0h1V7dlZhVh/yKO/7q3hvEcUzc1de8IN7mqjv69maMjF6jsc bFkACe+Dvzv2L+LMQxcN6mRnWWAP1cCzYza3hpL8cd7ihZRCvbqLkPqVSiaYyR+p YITTj0dvEcL7XhFe9cn72YLEBpVIomB1ZNTcp33xBHAVRLfjVvjqxq+rZ3E9btRs OSEDkEmbgZ31k5jpmhdSeZbPLwzSj4aNrLm+3Brxn2k2S9gCDZObNBlpvjt/wZhq kkAxzFOyb6c0bjuJ/hA14eGdFuaxphQzg327u5zm3zFwGHbRPqd/iOqprw3XmylQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddukedgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkgggtugfgsehtkeertd dttdejnecuhfhrohhmpefnvghoucfhrghmuhhlrghrihcuoehlvghosehfrghmuhhlrghr ihdrnhgrmhgvqeenucggtffrrghtthgvrhhnpeeiffdujeeiteetjefgfeetgfetvefgje dtheeghfelvefggfetffeuieejgfevkeenucffohhmrghinhepghhnuhdrohhrghenucfk phepuddttddruddurdduieelrdduudeknecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomheplhgvohesfhgrmhhulhgrrhhirdhnrghmvg X-ME-Proxy: Received: from localhost (pool-100-11-169-118.phlapa.fios.verizon.net [100.11.169.118]) by mail.messagingengine.com (Postfix) with ESMTPA id 59BB11080063 for ; Wed, 10 Mar 2021 12:05:39 -0500 (EST) Date: Wed, 10 Mar 2021 12:05:37 -0500 From: Leo Famulari To: help-guix@gnu.org Subject: How to compose sysctl-service-type? Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=66.111.4.26; envelope-from=leo@famulari.name; helo=out2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615397177; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=SbP+4+5LAeeM2BHwCdpOd2R36AGU+DEEz7iN5Qfc8VY=; b=nHMp+9gXwSVFRc+o1283Zu94yv3pcJ1KZSB1uXVVlMx9BCq/v60k/btStioltrFuttKi1Q tBxaeVn01+zhrSt3UDM+zxT8LAQIfQdA1MDZnSSWgnnIR4/4DH6NK5MIoPAn8u3T6w1mgC 1ekR8FHZu4Qde0Ud7gplsXKzEKJA8m1yL30AV7EBn0yDXCv0JL3rgW0vobY1ivP/3WC4wN hTNI3I4D/xVgntnYaVwUUUNru+zM2utf+Vgs/OsNjlLj942XTJQ0FLNshPz4hr7QNkAnNw UNczlJ3Nb5H1t5tTWSNibPkHUn049roRwHdAB3Pxq8VtQdsLg5DXw9Bmor0Kwg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615397177; a=rsa-sha256; cv=none; b=nRovQOfSvrEW2UuD+cypvQnrlEQnKIC1pZzA57mSyGgXFQQXTpoMRuqFbdG5GxSK+mGR60 PIO/idG4xyWZA7SnCKRjEDlDiiTLLuAxVRPNYVleqrjARabepyM5aVu+DS5Kj4F4cpJr/S hCkje52QAZqww2U5CtplEk8pI6qkZb7Qdmt8JhHArPPQisKCye+F7q7q7XrHdLMT1ldHTf T/vhF3wvKHK7aITcwEY+CUcOcs5DOjUBhgBBllVmUoLEvBmA4hZGYhEwskIe1U8MA/5O+J LUi1JXmkAz76Dhr/j+3vYaZb+lmP2gSq1qSALYB3bhRVLGA5SvmLPCdflH1syw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=famulari.name header.s=mesmtp header.b=ERA6Hwts; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm2 header.b=CYxy1szj; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Spam-Score: -0.39 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=famulari.name header.s=mesmtp header.b=ERA6Hwts; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm2 header.b=CYxy1szj; dmarc=none; spf=pass (aspmx1.migadu.com: domain of help-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=help-guix-bounces@gnu.org X-Migadu-Queue-Id: 20BB32437E X-Spam-Score: -0.39 X-Migadu-Scanner: scn1.migadu.com X-TUID: OkWoLDCP5XKj I'm trying to set some default sysctl settings for Guix System: https://bugs.gnu.org/47013 The problem is that I can't figure out how to compose the sysctl-service-type. Overall, I'm really confused at the variety of ways that services are created and used. If we put (service sysctl-service-type ...) in %base-services, then users cannot set their own things in config.scm, because it fails with "guix system: error: service 'sysctl' provided more than once". On the other hand, special-files-service-type can be used this way. So I tried to make a simple-service 'default-sysctl-settings': ------ diff --git a/gnu/services/base.scm b/gnu/services/base.scm index f6a490f712..68058efe15 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -35,6 +35,7 @@ #:use-module (gnu services) #:use-module (gnu services admin) #:use-module (gnu services shepherd) + #:use-module (gnu services sysctl) #:use-module (gnu system pam) #:use-module (gnu system shadow) ; 'user-account', etc. #:use-module (gnu system uuid) @@ -2484,6 +2485,14 @@ to handle." (requirement requirement) (name-servers name-servers))))) +(define (default-sysctl-settings default-settings) + (simple-service 'base-sysctl-settings + sysctl-service-type + default-settings)) + (define %base-services ;; Convenience variable holding the basic services. @@ -2532,6 +2541,12 @@ to handle." (udev-configuration (rules (list lvm2 fuse alsa-utils crda)))) + (service default-sysctl-settings + (sysctl-configuration + (settings + '(("fs.protected_hardlinks" . "1") + ("fs.protected_symlinks" . "1"))))) + (service special-files-service-type `(("/bin/sh" ,(file-append bash "/bin/sh")) ("/usr/bin/env" ,(file-append coreutils "/bin/env")))))) ------ But, that crashes like this: ------ Backtrace: In guix/ui.scm: 2164:12 19 (run-guix-command _ . _) In ice-9/boot-9.scm: 1736:10 18 (with-exception-handler _ _ #:unwind? _ # _) 1731:15 17 (with-exception-handler # …) In guix/scripts/system.scm: 1394:8 16 (_) In guix/status.scm: 780:4 15 (call-with-status-report _ _) In guix/scripts/system.scm: 1228:4 14 (_) In ice-9/boot-9.scm: 1736:10 13 (with-exception-handler _ _ #:unwind? _ # _) In guix/store.scm: 636:37 12 (thunk) 1305:8 11 (call-with-build-handler # …) 2066:24 10 (run-with-store # …) In guix/scripts/system.scm: 823:2 9 (_ _) 705:7 8 (_ #) In gnu/system/vm.scm: 737:31 7 (system-qemu-image/shared-store-script _ #:system _ # _ …) 661:2 6 (system-qemu-image/shared-store #< k…> …) In gnu/system.scm: 1231:38 5 (operating-system-uuid #< kernel: #<…> …) In gnu/services.scm: 963:4 4 (instantiate-missing-services _) In guix/combinators.scm: 46:26 3 (fold2 # …) In gnu/services.scm: 954:11 2 (adjust-service-list _ (#< type: # …) …) In ice-9/boot-9.scm: 1669:16 1 (raise-exception _ #:continuable? _) 1669:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1669:16: In procedure raise-exception: In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): # ------