guix/gnu/services
Rutherther e9cd72875e
services: guix: Fix case when /etc/guix/acl is a dangling symlink.
One possible solution for an issue when /etc/guix/acl file exists, but points
to a non-existent location. This can for example happen if one is
reinitializing the system, and remove only /gnu/store and /var/guix, keep the
rest okay. This is a major advantage of guix as compared to other distros that
usually need you to reinitialize the whole root partition. But this will leave
the user with acl file pointing to non-existent location. The file-exists?
procedure will return #f for broken symbolic links.

I think that another reason one would get this issue is, if one was booted in
a live iso, chrooted, fixing their system. They would switch generations to
one with different acl file, delete other generations gc rooting the original
acl file and then gc. One could do this approach for example when recovering
from file corruptions in the store, to get rid of the unsubstitutable paths
that can't be repaired with guix gc --verify.

This fixes the issue by looking for type of a file through lstat, instead of
relying on file-exists?. If the symlink is a broken symlink, it is
removed. Other than that the old behavior is kept:
- If regular file, back it up
- If symlink pointing to the store, remove it
- If symlink not pointing to the store, back it up

* gnu/services/base.scm (substitute-key-authorization): Check if acl file is a
possibly-dangling symbolic link.

Change-Id: I2f8170606b2f4afeea48f04acfd738b04cafc7cf
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Modified-by: Ludovic Courtès <ludo@gnu.org>
2025-05-05 14:33:59 +02:00
..
admin.scm services: file-database: Search ‘updatedb’ in package. 2025-04-01 14:49:34 +02:00
audio.scm gnu: Fix some misspellings. 2025-02-19 11:21:47 +02:00
auditd.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
authentication.scm
avahi.scm
backup.scm services: shepherd: Factorize ‘trigger’ action. 2025-03-23 19:29:14 +01:00
base.scm services: guix: Fix case when /etc/guix/acl is a dangling symlink. 2025-05-05 14:33:59 +02:00
certbot.scm services: certbot: Turn into a Shepherd timer. 2025-03-23 19:29:57 +01:00
cgit.scm
ci.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
configuration.scm services/configuration: Fix case where sub-documentation is nonexistent. 2025-03-18 16:12:38 +09:00
containers.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
cuirass.scm services: cuirass: Really allow ‘parameters’ to be a file-like object. 2025-03-21 13:29:18 +01:00
cups.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
databases.scm services: postgresql-role: Add support for password files. 2025-05-02 15:32:25 +09:00
dbus.scm
desktop.scm Partial revert "services: plasma: Fix kded not being started." 2025-05-04 21:58:41 +08:00
dict.scm services: dico: Add symbols to help users configure FreeDict with dicod. 2025-01-26 22:09:28 +01:00
dns.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
docker.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
file-sharing.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
games.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
ganeti.scm services: ganeti: Produce Shepherd timers instead of mcron jobs. 2025-03-23 19:30:44 +01:00
getmail.scm
guix.scm services: guix-data-service: Use a script for database setup. 2025-03-12 09:27:47 +00:00
herd.scm services: herd: Use a smarter default for %shepherd-socket-file. 2025-04-22 11:35:23 +09:00
hurd.scm
kerberos.scm
ldap.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
lightdm.scm services: lightdm: Fix vnc server flag listen-address 2025-02-18 18:20:01 +01:00
linux.scm services: fstrim: Turn into a Shepherd timer. 2025-03-23 19:29:49 +01:00
lirc.scm
mail.scm services: opensmtpd: Add logging to a file. 2025-04-10 15:40:25 +02:00
mcron.scm
messaging.scm services: pounce: New service. 2025-04-22 11:35:24 +09:00
monitoring.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
networking.scm services: network-manager: Handle existing configuration directory. 2025-03-23 10:28:33 -07:00
nfs.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
nix.scm
pam-mount.scm
pm.scm services: tlp: Make destructor return #f on success. 2025-04-08 17:06:58 +02:00
power.scm Add missing license file headers. 2025-03-11 14:50:47 -07:00
rsync.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
samba.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
science.scm
sddm.scm
security-token.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
security.scm
shepherd.scm services: shepherd: Add ‘shepherd-timer’. 2025-03-23 19:30:57 +01:00
sound.scm gnu: speakersafetyd: Add log file. 2025-04-14 13:49:29 +09:00
spice.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
ssh.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
syncthing.scm services: syncthing: Improve Syncthing code standard compliance. 2025-03-14 16:01:34 -04:00
sysctl.scm
telephony.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
upnp.scm services: readymedia: Change cache and log directory permissions to 755. 2025-03-25 11:37:02 +01:00
version-control.scm services: gitolite-service-type: Allow setting the admin name. 2025-04-03 21:16:24 +09:00
virtualization.scm services: Normalize and improve libvirt-configuration documentation. 2025-05-02 09:53:54 +09:00
vnc.scm services: Add missing Shepherd dependency on ‘user-processes’. 2025-02-23 22:53:06 +01:00
vpn.scm services: wireguard: Turn monitoring into a Shepherd timer. 2025-03-23 19:30:05 +01:00
web.scm services: anonip: Rotate log files. 2025-04-08 17:12:29 +02:00
xorg.scm services: gdm: Set GUIX_GDK_PIXBUF_MODULE_FILES. 2025-03-02 20:31:48 +01:00