From patchwork Sun Jan 2 18:03:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jorge Acereda X-Patchwork-Id: 35907 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 5ABBD27BBEA; Sun, 2 Jan 2022 23:08:34 +0000 (GMT) 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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS 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 D74BA27BBE9 for ; Sun, 2 Jan 2022 23:08:33 +0000 (GMT) Received: from localhost ([::1]:53866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n49xo-0002qy-Tg for patchwork@mira.cbaines.net; Sun, 02 Jan 2022 18:08:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n49hq-0002HW-KK for guix-patches@gnu.org; Sun, 02 Jan 2022 17:52:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:50578) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n49hq-0008Pe-Ar for guix-patches@gnu.org; Sun, 02 Jan 2022 17:52:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n49hq-0008UP-As for guix-patches@gnu.org; Sun, 02 Jan 2022 17:52:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45105] [PATCH v3] gnu: Add mbpfan service. References: <87a6ups6pd.fsf@posteo.net> In-Reply-To: <87a6ups6pd.fsf@posteo.net> Resent-From: Jorge Acereda Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 02 Jan 2022 22:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45105 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45105@debbugs.gnu.org Received: via spool by 45105-submit@debbugs.gnu.org id=B45105.164116390232592 (code B ref 45105); Sun, 02 Jan 2022 22:52:02 +0000 Received: (at 45105) by debbugs.gnu.org; 2 Jan 2022 22:51:42 +0000 Received: from localhost ([127.0.0.1]:33889 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n49hW-0008Tc-8q for submit@debbugs.gnu.org; Sun, 02 Jan 2022 17:51:42 -0500 Received: from mail-wm1-f51.google.com ([209.85.128.51]:54130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n45Cl-0004ee-Su for 45105@debbugs.gnu.org; Sun, 02 Jan 2022 13:03:40 -0500 Received: by mail-wm1-f51.google.com with SMTP id l4so20273934wmq.3 for <45105@debbugs.gnu.org>; Sun, 02 Jan 2022 10:03:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=jEy542yM6wbsBjSmyCDFUetKuJ2c8R0oMFhI9untU/8=; b=YF4jw0Do/5i0l6zZSCJO7tBkPNLnlOZxZJj2xdOFOQ7iP2yoopsc06FFT+Zcz7AHJU 6Tln2ls9ABLDA8tWirRB3m+cxra2r9WfUX7czHhjqJdFV+cGtmo7NSWoxdKZySw66YAw 8O955Z+Ad0+w+3KqQorWfHbWCAPe1nV9P9n1FlHWq525rzGpRvbCpQyvVdnO2egDkuD9 l5xwtpKd0FeVIR/Ns4LYwD0Ni1J40oJsiiB8Ktaqxfr6EXADmSDZtLOeZyhIbBegZDah fyYvMSXywIIoUT5vKo0Hnun6aFHeGfaXSZsSWcmCej02+u/cNAvXCJHSOIa88aGiRpab 1cTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=jEy542yM6wbsBjSmyCDFUetKuJ2c8R0oMFhI9untU/8=; b=moxyRhfGlTPdYcdjMM8gmUjugK//LfB6NATdi2gqj2e7pPihzEXQA9a5DBWfEP33j1 UC56CzPbRoa4Fo+EgNoyu8j0cr8+bQ59VYeKIwnXIFPAmt04A4SN78vbschTVp64Y5G7 Rlp1MVql1If8zrYajm+z4lbJPY7xwmfsX3yqJ5gje9t0v8nkBKp0J/ty8At6T2yRMBRL 6hwFylUUlWLnzrYYZsBXwzOJtKIVdfzihxR2rJxr/wMkrCszVKsK3/l1JX28+7T4/W/Q j3Yg0fJ8oFS5iN0HGceAEZLscStrr8g1YwyVi8/CHCjH2tMCKnYLrSXy6EoCrlDcks2E b8Rg== X-Gm-Message-State: AOAM531772UuwxvPLOA/Z+pibflwPE5UEZxUcmtC0j8QLYALYIn3DLMY 2Q275tNoYfKakchSUnZhEsj57LRVrgcyng== X-Google-Smtp-Source: ABdhPJwHcz2pSvG8poQs50ELWnxb+c19fj8X30MnPM9kK7zvhAf96gt9UHFbCGa7+XcTtnzhq7UXjA== X-Received: by 2002:a05:600c:c6:: with SMTP id u6mr8536304wmm.50.1641146613954; Sun, 02 Jan 2022 10:03:33 -0800 (PST) Received: from mbp ([185.39.42.151]) by smtp.gmail.com with ESMTPSA id i15sm23181362wrf.6.2022.01.02.10.03.32 for <45105@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jan 2022 10:03:33 -0800 (PST) From: Jorge Acereda Date: Sun, 02 Jan 2022 19:03:28 +0100 Message-ID: <87bl0uypzj.fsf@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 02 Jan 2022 17:51:40 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sun, 02 Jan 2022 18:08:22 -0500 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" X-getmail-retrieved-from-mailbox: Patches Hi, I've added the service to gnu/local.mk, verified it can correctly start/stop and been using it for some days without problems. Regards, Jorge Acereda From 186bd7c2c37b11e3e8a3314ef77bcaf9e993b642 Mon Sep 17 00:00:00 2001 Message-Id: <186bd7c2c37b11e3e8a3314ef77bcaf9e993b642.1641146492.git.jacereda@gmail.com> From: Jorge Acereda Date: Wed, 29 Dec 2021 23:44:59 +0100 Subject: [PATCH v3] gnu: Add mbpfan service --- gnu/local.mk | 1 + gnu/services/mbpfan.scm | 72 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 gnu/services/mbpfan.scm diff --git a/gnu/local.mk b/gnu/local.mk index 68a83f5cf8..ac9ed76e68 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -652,6 +652,7 @@ GNU_SYSTEM_MODULES = \ %D%/services/lirc.scm \ %D%/services/virtualization.scm \ %D%/services/mail.scm \ + %D%/services/mbpfan.scm \ %D%/services/mcron.scm \ %D%/services/messaging.scm \ %D%/services/monitoring.scm \ diff --git a/gnu/services/mbpfan.scm b/gnu/services/mbpfan.scm new file mode 100644 index 0000000000..493ca70bb7 --- /dev/null +++ b/gnu/services/mbpfan.scm @@ -0,0 +1,72 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2020 Niklas Eklund +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services mbpfan) + #:use-module (gnu packages linux) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu services shepherd) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (ice-9 match) + #:use-module (ice-9 format) + #:use-module (guix modules) + #:export (mbpfan-service-type + + mbpfan-configuration + mbpfan-configuration?)) + +;;; Commentary: +;;; +;;; This module provides a service definition for the mbpfan. +;;; +;;; Code: + +(define-record-type* + mbpfan-configuration make-mbpfan-configuration + mbpfan-configuration? + (log-file mbpfan-configuration-log-file ;string + (default "/var/log/mbpfan.log")) + (verbose? mbpfan-configuration-verbose? (default #f))) + +(define mbpfan-shepherd-service + (match-lambda + (($ log-file verbose?) + (list + (shepherd-service + (documentation "Run the mbpfan daemon.") + (provision '(mbpfan)) + (requirement '(syslogd)) + (start #~(make-forkexec-constructor + (list #$(file-append mbpfan "/sbin/mbpfan") + "-f" + #$@(if verbose? + '("-v") ; verbose logging + '())) + #:log-file #$log-file)) + (stop #~(make-kill-destructor))))))) + +(define mbpfan-service-type + (service-type + (name 'mbpfan) + (extensions + (list (service-extension shepherd-root-service-type + mbpfan-shepherd-service))) + (description + "Run the MacBook/Macbook Pro fan daemon.") + (default-value (mbpfan-configuration))))