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 oL+BMg2hol+sDQAA0tVLHw (envelope-from ) for ; Wed, 04 Nov 2020 12:39:41 +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 8G1fLg2hol8KZAAA1q6Kng (envelope-from ) for ; Wed, 04 Nov 2020 12:39:41 +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 46E27940111 for ; Wed, 4 Nov 2020 12:39:41 +0000 (UTC) Received: from localhost ([::1]:49010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaI4h-0006AM-KB for larch@yhetil.org; Wed, 04 Nov 2020 07:39:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaI46-0006A7-TG for guix-patches@gnu.org; Wed, 04 Nov 2020 07:39:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:36276) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kaI46-0002VK-HM for guix-patches@gnu.org; Wed, 04 Nov 2020 07:39:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kaI46-0006j1-EA for guix-patches@gnu.org; Wed, 04 Nov 2020 07:39:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44435] [PATCH 0/1] services: Add Transmission Daemon Resent-From: Simon South Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 04 Nov 2020 12:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44435 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 44435@debbugs.gnu.org Cc: simon@simonsouth.net X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.160449354125842 (code B ref -1); Wed, 04 Nov 2020 12:39:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Nov 2020 12:39:01 +0000 Received: from localhost ([127.0.0.1]:47822 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaI43-0006ii-Bq for submit@debbugs.gnu.org; Wed, 04 Nov 2020 07:39:01 -0500 Received: from lists.gnu.org ([209.51.188.17]:37774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kaI3y-0006iX-6j for submit@debbugs.gnu.org; Wed, 04 Nov 2020 07:38:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaI3y-00068Q-03 for guix-patches@gnu.org; Wed, 04 Nov 2020 07:38:54 -0500 Received: from mailout.easymail.ca ([64.68.200.34]:38862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaI3p-0002U6-PN for guix-patches@gnu.org; Wed, 04 Nov 2020 07:38:53 -0500 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id 19391C0CCC; Wed, 4 Nov 2020 12:38:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at emo04-pco.easydns.vpn Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (emo04-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id L37jmt74Fghm; Wed, 4 Nov 2020 12:38:41 +0000 (UTC) Received: from localhost.localdomain (unknown [108.162.141.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id E78EFBF788; Wed, 4 Nov 2020 12:38:39 +0000 (UTC) From: Simon South Date: Wed, 4 Nov 2020 07:37:31 -0500 Message-Id: X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=64.68.200.34; envelope-from=simon@simonsouth.net; helo=mailout.easymail.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/04 07:38:42 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.3 (--) 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-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; 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-Spam-Score: 5.49 X-TUID: 8nAEApNvSQ8l This patch adds a service type for Transmission Daemon, the headless variant of the Transmission BitTorrent client (https://transmissionbt.com/). Running the client as a service this way makes it possible to share files over BitTorrent continuously without requiring a user be logged in. I've tried to make this as complete as possible but am especially interested in geting feedback as this is my first attempt at creating a service definition. A few things to point out: - I've placed the code in a new "(gnu services file-sharing)" module and the documentation in a new "File-Sharing Services" section of the manual, only because these names seemed the most natural to me. ("Peer-to-peer" would be too broad a categorization, I think, while "BitTorrent" too narrow.) - The module exports two procedures, "transmission-password-hash" and "transmission-random-salt", that together are my solution to the problem of assigning a value to the daemon's "rpc-password" configuration setting. Transmission clients seem to expect the user to supply a password in plaintext in their "settings.json" file. At startup, the client generates a random, eight-character salt value; hashes it and the password together; and writes the result back to the settings file, after which the password remains obscured. This obviously violates the functional nature of Guix, as we don't expect services to be rewriting their own configuration files and the use of a random salt value makes the process non-repeatable anyway. I've documented in the manual how a user can use these two procedures to create a suitable value for "rpc-password" that remains stable across system reconfigurations, but perhaps you know of a better (or more conventional) approach. - I've added a custom "stop" procedure to the Shepherd service that gives the daemon time to shut down before eventually killing its process. This is necessary since the daemon performs some housekeeping and sends a final update to BitTorrent trackers before it exits, which can take several seconds or more; without this code, restarting the service usually fails as the new daemon process finds the old one is still running and attached to the port used for peer connections. Again, the approach I've used to handle this seems reasonable to me but perhaps you know of something better. -- Simon South simon@simonsouth.net Simon South (1): services: Add transmission-daemon service. doc/guix.texi | 799 +++++++++++++++++++++++++++++++++ gnu/local.mk | 1 + gnu/services/file-sharing.scm | 806 ++++++++++++++++++++++++++++++++++ 3 files changed, 1606 insertions(+) create mode 100644 gnu/services/file-sharing.scm -- 2.28.0