From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uOKjDAfyCGHvHwEAgWs5BA (envelope-from ) for ; Tue, 03 Aug 2021 09:36:39 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id YPZLCAfyCGETCQAAB5/wlQ (envelope-from ) for ; Tue, 03 Aug 2021 07:36:39 +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 813A9196D0 for ; Tue, 3 Aug 2021 09:36:38 +0200 (CEST) Received: from localhost ([::1]:38642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mAoyb-0000RV-I3 for larch@yhetil.org; Tue, 03 Aug 2021 03:36:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mAoy2-0000RK-Fj for guix-patches@gnu.org; Tue, 03 Aug 2021 03:36:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56452) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mAoy2-00049E-7i for guix-patches@gnu.org; Tue, 03 Aug 2021 03:36:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mAoy2-00074f-0c for guix-patches@gnu.org; Tue, 03 Aug 2021 03:36:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47849] [PATCH] Add a jami-daemon service. Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 03 Aug 2021 07:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47849 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: 47849@debbugs.gnu.org, Maxime Devos Received: via spool by 47849-submit@debbugs.gnu.org id=B47849.162797613027154 (code B ref 47849); Tue, 03 Aug 2021 07:36:01 +0000 Received: (at 47849) by debbugs.gnu.org; 3 Aug 2021 07:35:30 +0000 Received: from localhost ([127.0.0.1]:39765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAoxW-00073u-7O for submit@debbugs.gnu.org; Tue, 03 Aug 2021 03:35:30 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:34190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mAoxT-00073k-3u for 47849@debbugs.gnu.org; Tue, 03 Aug 2021 03:35:28 -0400 Received: from nijino.local (194-118-35-216.adsl.highway.telekom.at [194.118.35.216]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4Gf6974b7Vz1LWpc; Tue, 3 Aug 2021 09:35:23 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4Gf6974b7Vz1LWpc DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1627976123; bh=d5qFHldXDqYI/8zq7FMRpk76zhPcB+bbNb0XjbWb4ZU=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=EuCN6cEQtUWiUMjs69TEvb91Tip0X5nIjoO3lIyBNM0ahNbiAmEtZ2d4KYX08faD5 TnfXwu8Q3IjlAInE6e5JFsxmKezzYP+dQSaY/c98hQne2r6+NeeVk3ONeBfk6/PIpU UQfssWu2OBJj6gDdAEUGTag/8lHlcjJX7mwRLZpk= Message-ID: <2a559e87966b2383d39ccfddbb667d67b9d21632.camel@student.tugraz.at> From: Leo Prikler Date: Tue, 03 Aug 2021 09:35:22 +0200 In-Reply-To: <878s1j8xmq.fsf_-_@gmail.com> References: <20210801065857.27657-1-maxim.cournoyer@gmail.com> <20210801065857.27657-4-maxim.cournoyer@gmail.com> <878s1j8xmq.fsf_-_@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 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=1627976198; 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: 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=d5qFHldXDqYI/8zq7FMRpk76zhPcB+bbNb0XjbWb4ZU=; b=XGUEg9UAWXuZzA0sxSvgCfIsgPOBd4wOEpwANMHslB0xmmuGp00uCiF0oHkEWYdRqmoZEz +Z67Ju7g2980sBKDX37FZe1D3sjlGaPCjpBnyT+G3/0JPC93rz3e0wIzESIJxiRUnyqKsS GV+kRcCpq7oaJ2Nb6ewPz3r2i38bzP/EVEwykngsJve/B6flfJz//HOmfEeKVw3CfVxc4I Jw3JxW7XGETua7PS9HqDGfawYLsjrHurAfYTYCSh6HWwiQdDFgGG4cyTDUlXQBXW2Zf8hy Ik9ozqVFLqkpbt5OhIszGJ8djInG10euVXuQIG/d2SAKRBjPUFhR9RAWb0xycg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627976198; a=rsa-sha256; cv=none; b=l/dQCmeLWyxSXskn6dh7kDa3+4mPGNiC49V/lYfF53TN5gs56XcyPk3rNaeXNLSg3ZAsxU R6FFQWiyhuLwwVigbo48Lnn1lxAUQEzPvUPwkf/V7x77f/d+8SLKHylsEhEDRaoG0JjI7C Dl8Ts1Hug16Z91PcpXctGloa1hu2zWiJxJmwFlzV5iTcgWnsb9mJoFB75zIkN0lKBR+64R ZDhW1/8y6zFVtI2oFIc0Loicujy+rhqLgkNvOa1JcQr4596cNGuftckGnThR8+sp7l16iA kUxCdFaZNlVz9a79U2IHl5E87AI8bQPGCv5vkVge0UgKc+xLo2koLcClJVkOlw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=EuCN6cEQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=student.tugraz.at (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.31 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b=EuCN6cEQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=student.tugraz.at (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: 813A9196D0 X-Spam-Score: -1.31 X-Migadu-Scanner: scn0.migadu.com X-TUID: oOmwCmRyzGLo Hi Maxim, Am Montag, den 02.08.2021, 15:17 -0400 schrieb Maxim Cournoyer: > > > + ,@(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. I think the cognitive burden would in both cases be lessened if we didn't need to write (or stuff (%send-dbus-stuff)) everywhere, which see below. > > 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. That's how define* works though, in my experience: --8<---------------cut here---------------start------------->8--- ;; foo.scm (define-module (foo) #:export (*rand* rand)) (define *rand* (make-parameter 4)) (define* (rand #:optional (value (*rand*))) value) --8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,use (foo) ;; alternatively (load-compiled "foo.go") scheme@(guile-user)> (rand) $1 = 4 scheme@(guile-user)> (parameterize ((*rand* 5)) (rand)) $2 = 5 scheme@(guile-user)> (rand 6) $3 = 6 --8<---------------cut here---------------end--------------->8--- > > > + (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. My bad, nvm then. > > 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. As I said, I only looked at parts of it, so this push was perhaps a bit hasty. I recently also hastily pushed something and had to fix it up later. Let's try to keep a cool head and not let the heat get to us :) Regards,