guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#73494] [PATCH 2/2] services: cleanup: Make /var/run a symlink of /r


From: Hilton Chain
Subject: [bug#73494] [PATCH 2/2] services: cleanup: Make /var/run a symlink of /run.
Date: Thu, 26 Sep 2024 15:05:29 +0800

* gnu/services.scm (cleanup-gexp): Make /var/run a symlink of /run.
* gnu/services/dbus.scm (dbus-activation): Adjust accordingly.

Change-Id: I7b94d3e2fe1bef66f435e84bc77f32311dddd0ce
---
 gnu/services.scm      |  3 +--
 gnu/services/dbus.scm | 31 -------------------------------
 2 files changed, 1 insertion(+), 33 deletions(-)

diff --git a/gnu/services.scm b/gnu/services.scm
index ea855ad193..50af5f56b6 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -668,8 +668,7 @@ (define (cleanup-gexp _)
            ;; hence the 'chmod' calls.
            (mkdir "/tmp" #o1777)
            (chmod "/tmp" #o1777)
-           (mkdir "/var/run" #o755)
-           (chmod "/var/run" #o755))))))
+           (symlink "/run" "/var/run"))))))
 
 (define cleanup-service-type
   ;; Service that cleans things up in /tmp and similar.
diff --git a/gnu/services/dbus.scm b/gnu/services/dbus.scm
index 76e04bf221..9292172e01 100644
--- a/gnu/services/dbus.scm
+++ b/gnu/services/dbus.scm
@@ -190,37 +190,6 @@ (define (dbus-activation config)
           ;; world-readable.
           (mkdir-p/perms "/run/dbus" user #o755))
 
-        (catch 'system-error
-          (lambda ()
-            (symlink "/run/dbus" "/var/run/dbus"))
-          (lambda args
-            (let ((errno (system-error-errno args)))
-              (cond
-               ((= errno EEXIST)
-                (let ((existing-name
-                       (false-if-exception
-                        (readlink "/var/run/dbus"))))
-                  (unless (equal? existing-name "/run/dbus")
-                    ;; Move the content of /var/run/dbus to /run/dbus, and
-                    ;; retry.
-                    (let ((dir (opendir "/var/run/dbus")))
-                      (let loop ((next (readdir dir)))
-                        (cond
-                         ((eof-object? next) (closedir dir))
-                         ((member next '("." "..")) (loop (readdir dir)))
-                         (else
-                          (begin
-                            (rename-file (string-append "/var/run/dbus/" next)
-                                         (string-append "/run/dbus/" next))
-                            (loop (readdir dir)))))))
-                    (rmdir "/var/run/dbus")
-                    (symlink "/run/dbus" "/var/run/dbus"))))
-               (else
-                (format (current-error-port)
-                        "Failed to symlink /run/dbus to /var/run/dbus: ~s~%"
-                        (strerror errno))
-                (error "cannot create /var/run/dbus"))))))
-
         (unless (file-exists? "/etc/machine-id")
           (format #t "creating /etc/machine-id...~%")
           (invoke (string-append #$(dbus-configuration-dbus config)
-- 
2.46.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]