summary refs log tree commit diff
path: root/gnu/services.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2017-10-12 14:52:53 +0200
committerLudovic Courtès <ludo@gnu.org>2017-10-12 17:51:41 +0200
commitaad8a143000600abec5c8ebfadec4c09f34f1b73 (patch)
tree50e0e177a01e45c0e2ad185c6f4fde27e66186f1 /gnu/services.scm
parentd8e89b1c794141b21ae4a87244d2c181b4a8460c (diff)
downloadguix-aad8a143000600abec5c8ebfadec4c09f34f1b73.tar.gz
services: cleanup: Remove Shadow lock files from /etc.
Partly fixes <https://bugs.gnu.org/28772>.
Reported by Oleg Pykhalov <go.wigust@gmail.com>.

* gnu/services.scm (cleanup-gexp): Remove /etc/{passwd,group}.lock and
/etc/.pwd.lock.
Diffstat (limited to 'gnu/services.scm')
-rw-r--r--gnu/services.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/gnu/services.scm b/gnu/services.scm
index 329b7b1513..0bd3620852 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -368,6 +368,12 @@ boot."
                                                 #t))))
                     ;; Ignore I/O errors so the system can boot.
                     (fail-safe
+                     ;; Remove stale Shadow lock files as they would lead to
+                     ;; failures of 'useradd' & co.
+                     (delete-file "/etc/group.lock")
+                     (delete-file "/etc/passwd.lock")
+                     (delete-file "/etc/.pwd.lock") ;from 'lckpwdf'
+
                      (delete-file-recursively "/tmp")
                      (delete-file-recursively "/var/run")
                      (mkdir "/tmp")