From patchwork Thu May 9 15:37:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrien 'neox' Bourmault X-Patchwork-Id: 27227 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 004F127BBE2; Thu, 9 May 2024 16:42:02 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id CEBB727BBE9 for ; Thu, 9 May 2024 16:42:00 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s55tq-0006jP-53; Thu, 09 May 2024 11:41:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s55tp-0006j7-Dc for guix-patches@gnu.org; Thu, 09 May 2024 11:41:37 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s55to-0002eW-PX for guix-patches@gnu.org; Thu, 09 May 2024 11:41:37 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s55uE-0004WI-FY for guix-patches@gnu.org; Thu, 09 May 2024 11:42:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70845] [PATCH] services: Add fancontrol-service-type Resent-From: Adrien 'neox' Bourmault Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 09 May 2024 15:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70845 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70845@debbugs.gnu.org Cc: Adrien 'neox' Bourmault X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.171526928917363 (code B ref -1); Thu, 09 May 2024 15:42:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 May 2024 15:41:29 +0000 Received: from localhost ([127.0.0.1]:55952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s55th-0004Vz-4U for submit@debbugs.gnu.org; Thu, 09 May 2024 11:41:29 -0400 Received: from lists.gnu.org ([2001:470:142::17]:33030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s55te-0004Vm-8I for submit@debbugs.gnu.org; Thu, 09 May 2024 11:41:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s55t6-0006Hy-D7 for guix-patches@gnu.org; Thu, 09 May 2024 11:40:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s55t5-0002Sh-EC; Thu, 09 May 2024 11:40:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=X3fpXJ/fDqZn4Z++RYpYtFhJ8wkuCFx37wWclyQH2gk=; b=KAtNhYkUQC+OKL F0rYLyazhaV+ESDqysGSGYpkpkSPmfC06+ADFtPfHHpVcruZwAu01zcjTTggrU0tYsvfM1LFCuwst 7xUcg9Afa8N7KuIhYYCUvQAl1nO4pqlKlDmU9LTiHVLDejvwO1khgu+YKvcTozGDi/nZGFOIDzfRA hQF26rtLxuDcQC/xZs9gxVyeMsWpDmLHYoM9mjeNbMirwtHJkLMEWoFdjUzsylIKzlGeDnbyGw2N4 gHXH44xITxgwvSQLWMHE5N9ZSWdLpXVynjnkfW8erIgxOH+RYZM7ra92z1UzXLSyp6nkYYC6rlDKz KrfySagyw7cehyJugVLA==; From: Adrien 'neox' Bourmault Date: Thu, 9 May 2024 17:37:43 +0200 Message-ID: <20240509154032.5047-1-neox@gnu.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hi! I've created a fancontrol service for my own use on a KGPE-D16 workstation, and wanted to share it with GNU Guix. The configuration has to be generated upstream with pwmconfig (lm-sensors package) and you just have to tell the service where it is for it to work. Change-Id: I120e54cbf849eebd088be2a4d0a0113ffcdfcd84 Signed-off-by: Adrien 'neox' Bourmault --- gnu/services/pm.scm | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm index 3daf484cc1..1b305e76a6 100644 --- a/gnu/services/pm.scm +++ b/gnu/services/pm.scm @@ -31,7 +31,9 @@ (define-module (gnu services pm) tlp-configuration thermald-configuration - thermald-service-type)) + thermald-service-type + + fancontrol-service-type)) (define (uglify-field-name field-name) (let ((str (symbol->string field-name))) @@ -466,3 +468,31 @@ (define thermald-service-type (default-value (thermald-configuration)) (description "Run thermald, a CPU frequency scaling service that helps prevent overheating."))) + +;;; +;;; fancontrol +;;; +;;; This service implements fan control in conjunction with the tools in the +;;; lm-sensors package (pwmconfig/fancontrol). + +(define (fancontrol-shepherd-service config) + (shepherd-service + (documentation "Run the fancontrol daemon (fancontrol-daemon)." ) + (provision '(fancontrol)) + (requirement '(udev user-processes)) + (start #~(make-forkexec-constructor + (list #$(file-append lm-sensors "/sbin/fancontrol") + #$config) + #:user "root" #:group "root" + #:log-file "/var/log/fancontrol.log")) + (stop #~(make-kill-destructor)))) + +(define fancontrol-service-type + (service-type + (name 'fancontrol) + (description + "Run fancontrol as a daemon.") + (extensions + (list (service-extension shepherd-root-service-type + (compose list fancontrol-shepherd-service)))))) +