From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id GCb4FMnuPGZtpgAAqHPOHw:P1 (envelope-from ) for ; Thu, 09 May 2024 17:42:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id GCb4FMnuPGZtpgAAqHPOHw (envelope-from ) for ; Thu, 09 May 2024 17:42:01 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=KAtNhYkU; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1715269321; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=X3fpXJ/fDqZn4Z++RYpYtFhJ8wkuCFx37wWclyQH2gk=; b=Zvq0Jd8Kh22gxyuTd2e7Tgdqtoc1yxOCfg0gJsZNMWv2Jeg4vi9ZvC49M1hYPlnXnYvuNx 6en37NThRa7+Jge9oF3uUXOplnvAw+OOe4t8bD5mVwfVCiat6jnl88heTVhL5EtZYy14d6 6KJh+ahlmxLtmo6P/cYppOq/JpNAAx5cIipIekLLpq/mxcd0bMsgq/FzgMvIOQ1KzDdBHi 4i+gIxz5gnyqc3GmPMglS4RDqNWXMFv+8bmJ3utVgZ/iZKiEmlkCZHCGYi0fTsW5PZOQRC a3DydYgjY0OcFhAhd64bn0O+Rsf+8VFGIW8ILi6hAd5zR+QFv6roAvVMh1SV4A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=KAtNhYkU; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715269321; a=rsa-sha256; cv=none; b=Z9KMeZ7nDjRl5yDZ02Kb4lAYJVtQsFfckJIXy9olO44OsBQJV1Cmr7XheuVcT3ALQZ9v6B omKNC/8MAdOeLWQVBFmS4hjDnPsV8G84uQXnucLzk6puFD/S3ksmZHFRz5CoHtorfYwRGb OnOrndJEgWh3asObz6H/iuFHYMmUd2CVXneIJxWf77kIqAFVWks4UKjCaiuROOWHQEPXOn AzLfsLH3DmCqMVAYlL1O6BIOvf717AqmmP5lFDw/rXDmrQaX95rX+5puv5VFnNWntDd5D4 Rz1T9vrqFirs6Q8USZ+rB3+iaN5sSxmO+aCVO1wxHSgoekz6subKI05Sodgesg== 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 DC9BC14A4E for ; Thu, 9 May 2024 17:42:00 +0200 (CEST) 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 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -5.59 X-Spam-Score: -5.59 X-Migadu-Queue-Id: DC9BC14A4E X-Migadu-Scanner: mx13.migadu.com X-TUID: drKixq5RZe2X 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)))))) + -- 2.41.0