Subject: [bug#73494] [PATCH v3 2/3] services: cleanup: Make /var/run a symlink of /run.

From: Z572 <[email-masked]>
Date: Tue, 29 Apr 2025 12:47:24 +0800

Maxim Cournoyer <[email-masked]> writes:

> Hi Hilton,
>
> Hilton Chain <[email-masked]> writes:
>
> [...]
>
>> As said in [1], I have changed to use bind mount instead, currently
>> locally and
>> available in [2].  This approach should get rid of symlink issues.
>
> As mentioned on IRC, I've tried all these, but I'm still left with a
> broken 'jami-provisioning' system test.  It still needs investigating to
> understand what is at cause.  I've tried many things such as having our
> dbus use /run instead of /var/run (via a graft -- I hope this was in
> effect in the system tests, it looks like it should), but the problem
> persisted.

mkdir-p/perms does not accept symlinks[1],

adjust mkdir-p/perms to

```
(mkdir-p "/var/run/jami")
(chown "/var/run/jami" (passwd:uid user) (passwd:gid user))
(chmod "/var/run/jami" #o700)
```

can work

and (@@ (gnu tests telephony) make-jami-os) need remove
shepherd-system-log-service-type and add syslog-service-type can
successed.

A rough modification is as follows.

From af0588f980006381c3f8e14f6502183a3d39a1b8 Mon Sep 17 00:00:00 2001
Message-ID: <[email-masked]>
From: Zheng Junjie <[email-masked]>
Date: Tue, 29 Apr 2025 12:46:01 +0800
Subject: [PATCH] quickfix

Change-Id: I6996b5627d732d1c261ae453da5d0916637b0288
---
 gnu/services/telephony.scm | 4 +++-
 gnu/tests/telephony.scm    | 5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gnu/services/telephony.scm b/gnu/services/telephony.scm
index 9926f4107de..a54fab7c4ac 100644
--- a/gnu/services/telephony.scm
+++ b/gnu/services/telephony.scm
@@ -309,7 +309,9 @@ (define (jami-dbus-session-activation config)
     #~(begin
         (use-modules (gnu build activation))
         (let ((user (getpwnam "jami")))
-          (mkdir-p/perms "/var/run/jami" user #o700)
+          (mkdir-p "/var/run/jami")
+          (chown "/var/run/jami" (passwd:uid user) (passwd:gid user))
+          (chmod "/var/run/jami" #o700)
           ;; Customize the D-Bus policy to allow 'root' to access other users'
           ;; session bus.  Also modify the location of the written PID file,
           ;; from the default '/var/run/dbus/pid' location.  This file is only
diff --git a/gnu/tests/telephony.scm b/gnu/tests/telephony.scm
index f03ea963f7e..219cb421647 100644
--- a/gnu/tests/telephony.scm
+++ b/gnu/tests/telephony.scm
@@ -30,6 +30,7 @@ (define-module (gnu tests telephony)
   #:use-module (gnu services telephony)
   #:use-module (guix gexp)
   #:use-module (guix modules)
+  #:use-module (gnu services shepherd)
   #:export (%test-jami
             %test-jami-provisioning
             %test-jami-provisioning-partial))
@@ -116,7 +117,9 @@ (define* (make-jami-os #:key provisioning? partial?)
                               (openssh-configuration
                                (permit-root-login #t)
                                (allow-empty-passwords? #t)))
-                     %base-services))
+                     (service syslog-service-type)
+                     (modify-services %base-services
+                       (delete shepherd-system-log-service-type))))
     (packages (cons* (specification->package "recutils")
                      (specification->package "strace")
                      %base-packages))))

base-commit: f76b9c4fdf88cbab81e3cac27841a6c56e3e32c9
prerequisite-patch-id: fabc087075461a425f06083732136418b4940e6d
prerequisite-patch-id: b59e27442300208442b59900e844855b9ed63d96
prerequisite-patch-id: 701e20f8b287553c49ece96290e71dd7ef145b6c
-- 
2.49.0

[1]
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/build/activation.scm?h=master#n92 and https://issues.guix.gnu.org/47584