From patchwork Mon May 13 14:06:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adrien 'neox' Bourmault X-Patchwork-Id: 27441 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 7F24027BBE9; Mon, 13 May 2024 15:08:25 +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 9C8B627BBE2 for ; Mon, 13 May 2024 15:08:24 +0100 (BST) 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 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. 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(-) base-commit: 7b0f145802f0c2c785014293d748721678fef824 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)))))) +