all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Hilton Chain via Guix-patches via <guix-patches@gnu.org>
To: 73494@debbugs.gnu.org
Cc: Hilton Chain <hako@ultrarare.space>
Subject: [bug#73494] [PATCH 2/2] services: cleanup: Make /var/run a symlink of /run.
Date: Thu, 26 Sep 2024 15:05:29 +0800	[thread overview]
Message-ID: <dcb67a0cf081d8dff06d12959acc53fb174540ad.1727334105.git.hako@ultrarare.space> (raw)
In-Reply-To: <cover.1727331040.git.hako@ultrarare.space>

* 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





      parent reply	other threads:[~2024-09-26  7:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-26  6:44 [bug#73494] [PATCH 0/2] tmpfs /run Hilton Chain via Guix-patches via
2024-09-26  7:05 ` [bug#73494] [PATCH 1/2] file-systems: %base-file-systems: Add " Hilton Chain via Guix-patches via
2024-09-26  7:05 ` Hilton Chain via Guix-patches via [this message]

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=dcb67a0cf081d8dff06d12959acc53fb174540ad.1727334105.git.hako@ultrarare.space \
    --to=guix-patches@gnu.org \
    --cc=73494@debbugs.gnu.org \
    --cc=hako@ultrarare.space \
    /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.