[bug#76102] services: greetd: Use mkdir-p in activation-script.

Message ID 5577a7f8cd6acd534c688e1eadeddb1f38e0b7c3.1738860609.git.dariqq@posteo.net
State New
Headers
Series [bug#76102] services: greetd: Use mkdir-p in activation-script. |

Commit Message

Dariqq Feb. 6, 2025, 4:50 p.m. UTC
  Reconfiguring a system would fail with guix system: error: mkdir: File exists "/run/user".

* gnu/services/base.scm (greetd-run-user-activation): Replace mkdir with mkdir-p.

Change-Id: I030d1f57c3292c518b3f17061f75258e8a72141c
---
 gnu/services/base.scm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)


base-commit: 3f76813d82530303881ffdac87de29da92eef880
  

Comments

Murilo Feb. 6, 2025, 6:20 p.m. UTC | #1
I suggest the commit message description to include the commit which introduced the bug.

My suggestion is to change:

> Reconfiguring a system would fail with guix system: error: mkdir: File exists "/run/user".

to

------
Fixes a bug introduced in ee0d1b144c1572433c9475c32c74d61c3be9c058 where
reconfiguring a system with ‘greetd-service-type’ would fail with:

  guix system: error: mkdir: File exists "/run/user".
------

Other than that, LGTM.

PS: I'm CC'ing Maxim here because they are familiar with [1], which just got
merged, and this seems simple enough to push. Sorry if I shouldn't have.

[1] https://issues.guix.gnu.org/75270
  
Maxim Cournoyer Feb. 7, 2025, 8:52 a.m. UTC | #2
Hi,

"Murilo" <murilo@disroot.org> writes:

> I suggest the commit message description to include the commit which introduced the bug.
>
> My suggestion is to change:
>
>> Reconfiguring a system would fail with guix system: error: mkdir: File exists "/run/user".
>
> to
>
> ------
> Fixes a bug introduced in ee0d1b144c1572433c9475c32c74d61c3be9c058 where
> reconfiguring a system with ‘greetd-service-type’ would fail with:
>
>   guix system: error: mkdir: File exists "/run/user".
> ------
>
> Other than that, LGTM.

Applied with your suggestion!
  

Patch

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 1f31df1d87..8d710114d1 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -3875,9 +3875,11 @@  (define (greetd-pam-service config)
            pam))))))
 
 (define (greetd-run-user-activation config)
-  #~(let ((d "/run/user"))
-      (mkdir d #o755)
-      (chmod d #o755)))
+  #~(begin
+      (use-modules (guix build utils))
+      (let ((d "/run/user"))
+        (mkdir-p d)
+        (chmod d #o755))))
 
 (define (greetd-shepherd-services config)
   (map