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 ms0.migadu.com with LMTPS id SP4xKPNECGFuYQEAgWs5BA (envelope-from ) for ; Mon, 02 Aug 2021 21:18:11 +0200 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 gMTiI/NECGESLwAA1q6Kng (envelope-from ) for ; Mon, 02 Aug 2021 19:18:11 +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 DA296C109 for ; Mon, 2 Aug 2021 21:18:10 +0200 (CEST) Received: from localhost ([::1]:39366 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mAdRx-0001wj-G4 for larch@yhetil.org; Mon, 02 Aug 2021 15:18:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAdRq-0001wC-KP for guix-patches@gnu.org; Mon, 02 Aug 2021 15:18:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55992) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mAdRq-0001fH-CO for guix-patches@gnu.org; Mon, 02 Aug 2021 15:18:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mAdRq-0001kg-6L for guix-patches@gnu.org; Mon, 02 Aug 2021 15:18:02 -0400 Subject: bug#47849: [PATCH] Add a jami-daemon service. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Mon, 02 Aug 2021 19:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 47849 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Leo Prikler Cc: Maxime Devos , 47849-done@debbugs.gnu.org Mail-Followup-To: 47849@debbugs.gnu.org, maxim.cournoyer@gmail.com, maxim.cournoyer@gmail.com Received: via spool by 47849-done@debbugs.gnu.org id=D47849.16279318466686 (code D ref 47849); Mon, 02 Aug 2021 19:18:01 +0000 Received: (at 47849-done) by debbugs.gnu.org; 2 Aug 2021 19:17:26 +0000 Received: from localhost ([127.0.0.1]:39305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAdRG-0001jm-CV for submit@debbugs.gnu.org; Mon, 02 Aug 2021 15:17:26 -0400 Received: from mail-qv1-f54.google.com ([209.85.219.54]:39552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAdRE-0001ja-JL for 47849-done@debbugs.gnu.org; Mon, 02 Aug 2021 15:17:25 -0400 Received: by mail-qv1-f54.google.com with SMTP id d3so9401292qvq.6 for <47849-done@debbugs.gnu.org>; Mon, 02 Aug 2021 12:17:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=tVWSt5E4pi4Rc8vFEdsY0uAXOABTes/j0Gxv9nekRU0=; b=NiDvAAI7GU9u4N3iIGa2dWYgnYanjESr06syuWMLtevx5cdcX4J5H3kd4W43+HAay+ NxNSDC+fEY2OHwkxK0b5niTTxwWqENV5STnXN5MRLAxJEvz6DnMRzX5cB507swSBEYvN i/ryp6Zm+T61OAL36fEwK24w87KNqlNdMXVwFgdLpEqf2fhU2TviPIHSBAIeD640eW43 9/1lIauoFTDu2lBVAe6PpuDeVuMzeEhKg7LXxJB0Pk34rr24dXNnlw+ZJxqgej3pUCEb OuEOzW4NEadDocSSzTe/vIC9fULlh3T1ELexyjinVk639DXadLRqg70L6h0eAvP66Jkx eeKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=tVWSt5E4pi4Rc8vFEdsY0uAXOABTes/j0Gxv9nekRU0=; b=qqqIfWoF4eqborJ26hHUaV4k7Jr617IJN44WSfKUkon2ftA3F7pa3oQUBX2zvI1SVK A+XLg6CNxPEuXI/LiE7GBXe9OetquExi8uzZFoMQ+7eD0oKSGo15AYkLExp5/KIG1vVC Z1r3+jMTiSakp/rV6NGyf5jfu75Y59TQr2i6ek7EJiDDe1xehq9eGkh1PM5+2D6c/feC ma0/2CFR6UBZB5K0eB9Q2FZBmx0vhG35qRQx5+2Wyyju0YHNY4z+9udQso7I1I6eYeRL 0n+326Ae9HRwZoiASzO7o4kOrUVmuGQnnw6MKWXkJ45KeF1nsLe1MbriN29FnBVWpYXD cBbw== X-Gm-Message-State: AOAM533gRDSLO6uQhlMjS8+WGrAQGIjpnxSmYn0FSokqOJOPSKx3OBAx 81bctFGkgGLiXNDa3M1SknI+SN9H6z1dXg== X-Google-Smtp-Source: ABdhPJyK+9RqQ0o2bHodSo+R2i1V50dcU2RBB2n5oSYbdtnHje4dvihCEeRIZct/R7g1A8fWbboeHQ== X-Received: by 2002:a05:6214:1bcf:: with SMTP id m15mr9069344qvc.62.1627931839065; Mon, 02 Aug 2021 12:17:19 -0700 (PDT) Received: from hurd ([207.35.94.204]) by smtp.gmail.com with ESMTPSA id t26sm4970377qtc.44.2021.08.02.12.17.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 12:17:18 -0700 (PDT) From: Maxim Cournoyer References: <20210801065857.27657-1-maxim.cournoyer@gmail.com> <20210801065857.27657-4-maxim.cournoyer@gmail.com> Date: Mon, 02 Aug 2021 15:17:17 -0400 In-Reply-To: (Leo Prikler's message of "Sun, 01 Aug 2021 09:58:02 +0200") Message-ID: <878s1j8xmq.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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=1627931891; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-to: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=tVWSt5E4pi4Rc8vFEdsY0uAXOABTes/j0Gxv9nekRU0=; b=XBTQ0vhkQn4FBgk1fho3PyPp+g3b4zNPZ4jTC/8fs60ZH9V2J0ilxFo7E7Olmuk8rOrW8M 0Maz7ZMJi9rZqqEv4uE2xFHelgSgKXzyKuJN5MABW4FLPJTZLEATcQBAdpnDsqhltgzaL5 C2C0zLhOWAy5daX2CKSoa8uYyJC5kWK/wxfzRB3rZg64pPk6KQlFpMCf6GP+54L+KdJSKX c4dicHzEAb8nCvIiFd1OjaLNcJ68ndcp86YcrqfCihlmxhFSWroYBwsi3JDs1xJyfclCpz 7rvpybEbMFz+lVy0FqVT0lTPkv/O/TmhC3TWSQpGpTZr0/h4Pdx69K77Lt+ttQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627931891; a=rsa-sha256; cv=none; b=TE7ey8l5TMcZiz0ZHtm5mRb3SlhO6yssev6YKipgj/b2IcrBfGUeiGEkxqNvKi5S5BhvIG nrXD3kWBB3RP0X0zRcwYYrVatIi051lfH8hogxr7ocW0OEBvFEqSeB0pEzTkoh3lQPrwVP 06GQ8JvMalUwSQGZvtSPNAw/D7Ig1PUOtY2J14h498isEpStadeRoxO5b+PoCae9E+KQik DGJsJDgNK8Ju9EjbC0FKNwtNnCcD4rAvfbTEpHRmAiBxAT8lVJIkzTWGi4/7OG/+C2X5Cj UL8Mn1SSQLCuj/z/NmSPHdmQr4z2mo2U+6pPH8Xf8sMTvX/mZ/FmEYmTokDQoQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=NiDvAAI7; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: -1.32 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=NiDvAAI7; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: DA296C109 X-Spam-Score: -1.32 X-Migadu-Scanner: scn0.migadu.com X-TUID: BWA/tf+NFQgG Hi Leo, Leo Prikler writes: > Hi, > > Am Sonntag, den 01.08.2021, 02:58 -0400 schrieb Maxim Cournoyer: >> [...] > >> + (let* ((command `(,@(if dbus-send >> + (list dbus-send) >> + (list (%send-dbus-binary))) > You can use non-splicing comma notation for things that are never > supposed to be lists. Good catch! >> + ,@(if (or bus (%send-dbus-bus)) >> + (list (string-append "--bus=" >> + (or bus (%send-dbus- >> bus)))) >> + '()) > You use this style here, but >> + (let* ((uid (or (and=> (or user (%send-dbus-user)) >> + (compose passwd:uid getpwnam)) -1)) >> + (gid (or (and=> (or group (%send-dbus-group)) >> + (compose group:gid getgrnam)) -1))) > this style here. I personally think using and=> everywhere would make > things a little clearer. I tried, but it seemed it had a bigger cognitive load to follow (or, and=>, compose, list, cut all in the same expression), so ended up keeping it as is. > More importantly, though >> +(define* (send-dbus #:key service path interface method >> + bus >> + dbus-send >> + user group >> + timeout >> + arguments) > If you e.g. write (bus (%send-dbus-bus)), I think the argument should > already be correctly passed upon the function call, no? the %send-dbus-bus is a parameter; if we were to provide it as a default value, it would be evaluated at the time the module is read (IIUC), but I want its value to be read at run time, when the procedure is called instead. >> + (chown temp-port uid gid))) >> + (lambda () >> + (let ((pid (fork+exec-command command >> + #:user (or user (%send-dbus- >> user)) >> + #:group (or group (%send-dbus- >> group)) >> + #:log-file temp-file))) >> + (match (waitpid pid) >> + ((_ . status) >> + (let ((exit-status (status:exit-val status)) >> + (output (call-with-port temp-port get-string- >> all))) >> + (if (= 0 exit-status) >> + output >> + (error "the send-dbus command exited with: " >> + command exit-status output))))))) > Since output is unused in the error case, I think you can move the get- > string-all there. It would make a difference if you were to e.g. close > temp-port before that. It's actually used as the last argument of the 'error' call :-). I added it as it was helpful to debug stderr messages from dbus-send. > I did not look at the rest of this patch, but 1+2 LGTM. > > Regards, Thanks a lot for having a look! It's been long in the making. Pushed as commit 69dcc24c9f. Closing. Maxim