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 YNF+BNkeQmZCUgEAqHPOHw:P1 (envelope-from ) for ; Mon, 13 May 2024 16:08:25 +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 YNF+BNkeQmZCUgEAqHPOHw (envelope-from ) for ; Mon, 13 May 2024 16:08:25 +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=I866xYzA; 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=1715609305; 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=uX0RU2AC0fsfPWwNET6lxAmgFmGuToW45xDxFWvzSXs=; b=Cslfdxzwj0YlsUHcBffRkGDAElBrWQ1UfTc8kn6fS1nKLKjklG3Gt/IxmCRidBayN9Lnhu uGs1iLwf9aw1kimu2ohVsgphCebU0m8dUsxz0WHH3MSjTfoNvUGbqzcLL3K+9x/MA8QxJt txRtExgCAl82j7KeyML2Mi/c/8aooPY8lvDzjmKXlG+TiG0+MLRfvEXE6r5tFU/0PGlDuS rdr+pUJz5nJX8mZpV1YsYt8t/NOpzPLfvY9Uhor8rPe0YrMr+O1buH9l+IPl6aMX5U7noj utJJ4IswTgikdtijEo+agz+KAE2UcT3lcTVAHXNHgUF9BiZi9HK3PHzAJTRZDg== 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=I866xYzA; 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=1715609305; a=rsa-sha256; cv=none; b=td1mWG1UtLeIqephD8HWA5wWOgj2ELiNvYJUbNkbHycEJxKqnfk1K+0/mYgN3/Ckm4eS8l CorvtzoRHHbRFJmdOHkz4BH8apnxqeY6RFq3/ZGZlmx8VWoWZPKJ8rhD8CgkPt5VAiarU0 I2SK+Wu61dgPBuCQ1wMP9zjfT4JYkFKRSG1cBROEyX/sWEeYxPUenpSCV4Ayu28jsXE3z4 XcMiSXvxnqwgFO36DiFogMFCbrVr8TwwQXXpaks+2rD3xz1VZP8NnWsxNhrtTmcgK7cdsF cVzFoMTodvVXH32c34UC3aL9yvvqCUxmBDNibDeR8z8OliKBNaC0xwDnNETxow== 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 BAF0B164D8 for ; Mon, 13 May 2024 16:08:24 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s6WLV-0005SU-J6; Mon, 13 May 2024 10:08:05 -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 1s6WLT-0005SE-6a for guix-patches@gnu.org; Mon, 13 May 2024 10:08:03 -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 1s6WLR-0006GB-R6 for guix-patches@gnu.org; Mon, 13 May 2024 10:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s6WLS-00024q-4O for guix-patches@gnu.org; Mon, 13 May 2024 10:08:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70845] [PATCH v2] services: Add fancontrol-service-type. References: <20240509154032.5047-1-neox@gnu.org> In-Reply-To: <20240509154032.5047-1-neox@gnu.org> Resent-From: Adrien 'neox' Bourmault Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 May 2024 14:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70845 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70845@debbugs.gnu.org Cc: Adrien 'neox' Bourmault Received: via spool by 70845-submit@debbugs.gnu.org id=B70845.17156092507969 (code B ref 70845); Mon, 13 May 2024 14:08:02 +0000 Received: (at 70845) by debbugs.gnu.org; 13 May 2024 14:07:30 +0000 Received: from localhost ([127.0.0.1]:32940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6WKw-00024T-7r for submit@debbugs.gnu.org; Mon, 13 May 2024 10:07:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s6WKq-00024N-Nw for 70845@debbugs.gnu.org; Mon, 13 May 2024 10:07:28 -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 1s6WKj-00066k-CI; Mon, 13 May 2024 10:07:18 -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=uX0RU2AC0fsfPWwNET6lxAmgFmGuToW45xDxFWvzSXs=; b=I866xYzAPangDR qYmZX+934nOp0SUDXl/JUhOfJ0/TsbE4hFtAOMIGRv9TqZruKB5l/fLrx6YT395umHXocmif9/se6 TVH47oYpAhd4uGnFiggmmljAJlF9UesJHopZlQAZr1h8kkXHQcG7hZnIxjq4gn2eyP/hq+Qq1tHKQ /SZwftHx1EFA9WiY6odnpKMLStqcE63UAaGQMXSle7DiebDJ8jRAYlf5jo1Gq5D1ueDvNIfm+bEik 2SVXWxXExS5is14hU04U4zYl41MIo41zEDW2pCfDU1m8ZRa3v4SJHKcdA7x5uUxcXGHUi68mpRHWO RiOITcxF9LlwOS5AoG0Q==; From: Adrien 'neox' Bourmault Date: Mon, 13 May 2024 16:06:27 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: -6.27 X-Spam-Score: -6.27 X-Migadu-Queue-Id: BAF0B164D8 X-Migadu-Scanner: mx13.migadu.com X-TUID: Z++H6XUuJJwC 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. This is the second version of this patch, fixing the lack of copyright notice and dot at the end of the commit message. Change-Id: I120e54cbf849eebd088be2a4d0a0113ffcdfcd84 Signed-off-by: Adrien 'neox' Bourmault --- gnu/services/pm.scm | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm index 3daf484cc1..2196673875 100644 --- a/gnu/services/pm.scm +++ b/gnu/services/pm.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Mathieu Othacehe +;;; Copyright © 2024 Adrien 'neox' Bourmault ;;; ;;; This file is part of GNU Guix. ;;; @@ -31,7 +32,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 +469,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)))))) + base-commit: 7b0f145802f0c2c785014293d748721678fef824 -- 2.41.0