gnu: dbus-service: only symlink /run/dbus the first time

Due to an error in the nesting of S-Expressions, the re-linking of
/var/run/dbus to /run/dbus would occur even if it was already a
correct symlink.  It should only happen if the symlink is different.

* gnu/services/dbus.scm (dbus-activation): Adjust accordingly.

Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
This commit is contained in:
Vivien Kraus 2024-01-05 09:56:46 +01:00 committed by Liliana Marie Prikler
parent 1cd97066c2
commit 0831c72df6
No known key found for this signature in database
GPG key ID: 442A84B8C70E2F87

View file

@ -210,9 +210,9 @@ (define (dbus-activation config)
(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")))
(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~%"