all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: neox <neox@gnu.org>
To: 73393@debbugs.gnu.org
Cc: Adrien 'neox' Bourmault <neox@gnu.org>
Subject: [bug#73393] [PATCH 2/2] services: sane-service-type: create lock path for plustek backend
Date: Fri, 20 Sep 2024 21:03:33 +0200	[thread overview]
Message-ID: <3ad4ed8a692d86a9bef0b2ea56921ae2bf882957.1726827449.git.neox@gnu.org> (raw)
In-Reply-To: <cover.1726827449.git.neox@gnu.org>

From: Adrien 'neox' Bourmault <neox@gnu.org>

* gnu/services/desktop.scm (sane-service-type): extend with an activation
 service to create the lockpath and give the right permissions


Change-Id: I187886d12b5f0b4fe21b03de178ea2187205387a
Signed-off-by: Adrien 'neox' Bourmault <neox@gnu.org>
---
 gnu/services/desktop.scm | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm
index 274aeeef9b..9eae4178fb 100644
--- a/gnu/services/desktop.scm
+++ b/gnu/services/desktop.scm
@@ -1408,6 +1408,17 @@ (define %sane-accounts
   ;; The '60-libsane.rules' udev rules refers to the "scanner" group.
   (list (user-group (name "scanner") (system? #t))))
 
+(define %sane-activation
+  #~(begin
+      (use-modules (guix build utils))
+      (let ((lockpath "/var/lock/sane")
+            (gid (vector-ref (getgrnam "scanner") 2)))
+        ;; Create the lock directory at runtime and give right perms
+        (mkdir-p lockpath)
+        (chown lockpath -1 gid)
+        (chmod lockpath #o770))
+      #t))
+
 (define sane-service-type
   (service-type
    (name 'sane)
@@ -1418,6 +1429,8 @@ (define sane-service-type
    (default-value sane-backends-minimal)
    (extensions
     (list (service-extension udev-service-type list)
+          (service-extension activation-service-type
+                             (const %sane-activation))
           (service-extension account-service-type
                              (const %sane-accounts))))))
 
-- 
2.46.0





  parent reply	other threads:[~2024-09-20 19:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-20 19:03 [bug#73391] [PATCH 0/2] SANE: fix a locking bug for plustek backend neox
2024-09-20 19:03 ` [bug#73392] [PATCH 1/2] gnu: sane-backends-minimal: fix lock path " neox
     [not found]   ` <handler.73392.B.172685906722683.ack@debbugs.gnu.org>
2024-09-20 19:21     ` [bug#73392] Acknowledgement ([PATCH 1/2] gnu: sane-backends-minimal: fix lock path for plustek backend) Adrien 'neox' Bourmault
2024-09-20 19:03 ` neox [this message]
2024-09-22  8:55   ` [bug#73393] [PATCH 2/2] services: sane-service-type: create lock path for plustek backend Adrien 'neox' Bourmault
2024-09-20 20:39 ` [bug#73391] [PATCH v2 0/2] SANE: fix a locking bug " neox
2024-09-22  9:07   ` [bug#73393] " Adrien 'neox' Bourmault
2024-09-21  8:01   ` [bug#73406] " Adrien 'neox' Bourmault
2024-09-20 20:39   ` [bug#73391] [PATCH v2 1/2] gnu: sane-backends-minimal: fix lock path " neox
2024-09-22  9:07     ` [bug#73393] " Adrien 'neox' Bourmault
2024-09-21  8:03     ` [bug#73406] " Adrien 'neox' Bourmault
2024-09-20 20:39   ` [bug#73391] [PATCH v2 2/2] services: sane-service-type: create " neox
2024-09-22  9:07     ` [bug#73393] " Adrien 'neox' Bourmault
2024-09-21  8:03     ` [bug#73406] " Adrien 'neox' Bourmault
2024-09-24 18:51   ` [bug#73393] [PATCH v2 0/2] SANE: fix a locking bug " Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ad4ed8a692d86a9bef0b2ea56921ae2bf882957.1726827449.git.neox@gnu.org \
    --to=neox@gnu.org \
    --cc=73393@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.