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 8C1eKQndEmGgGwEAgWs5BA (envelope-from ) for ; Tue, 10 Aug 2021 22:09:45 +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 AMD8JAndEmHaIgAAbx9fmQ (envelope-from ) for ; Tue, 10 Aug 2021 20:09:45 +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 D61CCE3C0 for ; Tue, 10 Aug 2021 22:09:40 +0200 (CEST) Received: from localhost ([::1]:53176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDY4B-0001SZ-RK for larch@yhetil.org; Tue, 10 Aug 2021 16:09:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDY3c-0000qh-0X for guix-patches@gnu.org; Tue, 10 Aug 2021 16:09:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49348) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDY3b-0007DU-Qg for guix-patches@gnu.org; Tue, 10 Aug 2021 16:09:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mDY3b-0007CD-MJ for guix-patches@gnu.org; Tue, 10 Aug 2021 16:09:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49969] [PATCH v2 5/7] gnu: desktop: Add seatd-service-type Resent-From: muradm Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Aug 2021 20:09:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49969 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49969@debbugs.gnu.org Received: via spool by 49969-submit@debbugs.gnu.org id=B49969.162862611727590 (code B ref 49969); Tue, 10 Aug 2021 20:09:03 +0000 Received: (at 49969) by debbugs.gnu.org; 10 Aug 2021 20:08:37 +0000 Received: from localhost ([127.0.0.1]:60886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDY37-0007Am-AZ for submit@debbugs.gnu.org; Tue, 10 Aug 2021 16:08:37 -0400 Received: from mail-ej1-f46.google.com ([209.85.218.46]:46818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDY2r-00079P-U7 for 49969@debbugs.gnu.org; Tue, 10 Aug 2021 16:08:22 -0400 Received: by mail-ej1-f46.google.com with SMTP id gs8so37607069ejc.13 for <49969@debbugs.gnu.org>; Tue, 10 Aug 2021 13:08:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=muradm-net.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=JLAQyW2C1YP3WI4eDDJWM2Ywvm62IDNoDCygivZzhz8=; b=eAIEYM6EOSMAj7XFyPpkzpxVPA7DqQ5PawhG+rrOGKq9kM5MYfxzUBrO/hwfAPUxvq Xz5CfnjSnqojX7YyOBli87KnneMtHBRux7uY2Iiwb4XczfPw/qvY1tGfd24RVObSZ5hC CcQ+ueHPZGCIOI0sLV5dLOUAsRDgJ4UAPfZ/NSdurW7wCiwl/W6IINHzMQwLN/m1pUZk gZ5Osee4RotflMqUDKSmp96jyqU3Szzq9hwvHuz1YGPEMm03MPBnWwu17m72e6gugLQN 0g8IHgxLadifNKh9sJKwZ0MaIjUtNnewaZv2il9AvK4zgh+1T9oS1/7c2syLV/FUVVlC u1ag== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JLAQyW2C1YP3WI4eDDJWM2Ywvm62IDNoDCygivZzhz8=; b=rPlMNqNDhPF5Z9uERl+XDKqwNnIc8TbBx4gyRrt1SNFdC901k6ptfySak1fFfv2fwd 5en0H+RtfezMPv9QPngWF7mh1liW4KsGDHGDIsD77ctLZEcS3Bp9l2oQEaebU22XIT7/ n0V9Sv2PI0THGu4vN314WMVv/TX3uy7E2I4kstrFNHtgzAMmY4Kdoif7QOP9GlpufeSH tzWdmU39o8SjseagE0whesGLwMbZIXkEzOxWSZYq/05X6xV3lAiToBHMEDJdHoC6124q 54uXaGA3Ymj71qsDMOq2CvWdqG/r7MpGM2IIzTn7f1sKl43gjeE0L8fQnqpZ6uDVm8oq WPvQ== X-Gm-Message-State: AOAM531DZj7faKgF2RY4kpQuf8vbnhPeFCqdnccaND+OMswPkMFYHJlm De7Cp4271hZO+C3NudPu32BG4XKlWMVFjg== X-Google-Smtp-Source: ABdhPJxWwHfbi7w/CV1LGrv9rsNKOqTF+f4R4F9QlaUdlI8HOwZqnfds6ltRMWljpk0uLgizXeNxeA== X-Received: by 2002:a17:906:b09:: with SMTP id u9mr247806ejg.496.1628626092089; Tue, 10 Aug 2021 13:08:12 -0700 (PDT) Received: from localhost.localdomain ([31.142.54.188]) by smtp.gmail.com with ESMTPSA id qa34sm7247582ejc.120.2021.08.10.13.08.10 for <49969@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 13:08:11 -0700 (PDT) From: muradm Date: Tue, 10 Aug 2021 23:07:54 +0300 Message-Id: <20210810200756.9581-5-mail@muradm.net> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210810193626.9186-1-mail@muradm.net> References: <20210810193626.9186-1-mail@muradm.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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=1628626181; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=T19fVSlkqqZaasp+hARh2surH2lmbpxFOH4I7cEswZQ=; b=o1EQP8vf2oHAapOgSiSl7gLxmbXBNeHVks/mS2CLGzuVG78ecoWjvI01jI92W8juRSgrkF +beikwJvOZfilg4CfLEPa9AyJQ4wFQTCjKx3Ff9XjvKLOxeX16VTY3BBdXwezYAGSMMKcY gT/npN6ziAaNkk4OCD9VAWmdwvGnYnhI0qBo5qfwXWHA4lZbcfYzKh1X8Oe36TDv4Zv9lL MBTATAl49L4VjLDS+gvFOZiMPKBRqVm7Fetl2GqCsNTx9ABxNtDZq5rtsxvNyVSiXuoVMg OjZlZHlRffo/PaHt/ufcTUmbPknVSrKoLLTdSlm36hxAeLucfikRR3LEWoyuLw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628626181; a=rsa-sha256; cv=none; b=e2aA9ahBTfAm/ntgtMs34hRPcuupn0PswIYnKWtXJxx2wYmL8Gq2l7zzeVG6tiveGDWfyp saZCLVrK0YmDviVeNX12JKbxcmG8NBC/nt+2v4b1kJhsz+w5kDoAOwiyTHAD4opwo7KUOK lTnocKf6Y6STnzf0ppYl/9cnVglKb69d6okwIJ4gD9I7vWsft+fKUS7TN9aEhDuWixJ9pt l/8ykXg1dXMTu7qOnv7Ht1bV3IQGzqySoVkMgi6JsoA7jyQlHSvQ+wLEN4sUtpypkLFxU8 Z/LOcTpEUswVpR1bJ+3KGx+4+F8JNaudG7LkcA+NgHzqdNbkwgWb2c7a3MPYvw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=muradm-net.20150623.gappssmtp.com header.s=20150623 header.b=eAIEYM6E; 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: -0.41 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=muradm-net.20150623.gappssmtp.com header.s=20150623 header.b=eAIEYM6E; 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: D61CCE3C0 X-Spam-Score: -0.41 X-Migadu-Scanner: scn1.migadu.com X-TUID: gHHQKz5pezM3 A seat management daemon, that does everything it needs to do. Nothing more, nothing less. Depends only on libc. * gnu/services/desktop.scm: Add seatd-service-type --- gnu/services/desktop.scm | 59 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index 64d0e85301..bfba9bccec 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2020 Tobias Geerinckx-Rice ;;; Copyright © 2020 Reza Alizadeh Majd ;;; Copyright © 2021 Brice Waegeneire +;;; Copyright © 2021 muradm ;;; ;;; This file is part of GNU Guix. ;;; @@ -39,7 +40,9 @@ #:use-module (gnu services networking) #:use-module (gnu services sound) #:use-module ((gnu system file-systems) - #:select (%elogind-file-systems file-system)) + #:select (%control-groups + %elogind-file-systems + file-system)) #:use-module (gnu system) #:use-module (gnu system setuid) #:use-module (gnu system shadow) @@ -154,6 +157,9 @@ gnome-keyring-configuration? gnome-keyring-service-type + seatd-configuration + seatd-service-type + %desktop-services)) ;;; Commentary: @@ -1182,6 +1188,57 @@ or setting its password with passwd."))) (define polkit-wheel-service (simple-service 'polkit-wheel polkit-service-type (list polkit-wheel))) + +;;; +;;; seatd-service-type -- minimal seat management daemon +;;; + +(define-record-type* seatd-configuration + make-seatd-configuration + seatd-configuration? + (seatd seatd-package (default seatd)) + (user seatd-user (default "root")) + (group seatd-group (default "users")) + (socket seatd-socket (default "/run/seatd/socket")) + (loglevel seatd-loglevel (default "error"))) + +(define (seatd-shepherd-service config) + (list (shepherd-service + (requirement '()) + ;; TODO: once cgroups is separate dependency + ;; here we should depend on it rather than elogind + (provision '(seatd elogind)) + (start #~(make-forkexec-constructor + (list #$(file-append (seatd-package config) "/bin/seatd") + "-u" #$(seatd-user config) + "-g" #$(seatd-group config) + "-s" #$(seatd-socket config)) + #:environment-variables + (list (string-append "SEATD_LOGLEVEL=" + #$(seatd-loglevel config))) + #:log-file "/tmp/seatd.log")) + (stop #~(make-kill-destructor))))) + +(define seatd-environment + (match-lambda + (($ _ _ _ socket) + `(("SEATD_SOCK" . ,socket))))) + +(define seatd-service-type + (service-type + (name 'seatd) + (extensions + (list + (service-extension session-environment-service-type + seatd-environment) + ;; TODO: once cgroups is separate dependency + ;; we should not mount it here + (service-extension file-system-service-type + (const %control-groups)) + (service-extension shepherd-root-service-type + seatd-shepherd-service))) + (default-value (seatd-configuration)))) + ;;; ;;; The default set of desktop services. -- 2.32.0