summary refs log tree commit diff
path: root/gnu/installer/final.scm
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2021-12-30 11:24:27 +0100
committerMathieu Othacehe <othacehe@gnu.org>2022-01-14 14:29:12 +0100
commit7c923e6cf4412db3ef22792d639b98f8fbf7f037 (patch)
tree7a0d0259b8fd4afe588e0f3265f65360df87f142 /gnu/installer/final.scm
parentee897e5f51104f41b3c2a0c2cbc7eb4e6c1e4d3e (diff)
downloadguix-7c923e6cf4412db3ef22792d639b98f8fbf7f037.tar.gz
installer: Remove an unused procedure.
* gnu/installer/final.scm (kill-cow-users): Remove it.
Diffstat (limited to 'gnu/installer/final.scm')
-rw-r--r--gnu/installer/final.scm30
1 files changed, 0 insertions, 30 deletions
diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm
index fc0b7803fa..c6987e6e58 100644
--- a/gnu/installer/final.scm
+++ b/gnu/installer/final.scm
@@ -105,36 +105,6 @@ USERS."
   (write-passwd password (string-append etc "/passwd"))
   (write-shadow shadow (string-append etc "/shadow")))
 
-(define* (kill-cow-users cow-path #:key (spare '("udevd")))
-  "Kill all processes that have references to the given COW-PATH in their
-'maps' file.  The process whose names are in SPARE list are spared."
-  (define %not-nul
-    (char-set-complement (char-set #\nul)))
-
-  (let ((pids
-         (filter-map (lambda (pid)
-                       (false-if-exception
-                        (call-with-input-file
-                            (string-append "/proc/" pid "/maps")
-                          (lambda (port)
-                            (and (string-contains (get-string-all port)
-                                                  cow-path)
-                                 (string->number pid))))))
-                     (scandir "/proc" string->number))))
-    (for-each (lambda (pid)
-                ;; cmdline does not always exist.
-                (false-if-exception
-                 (call-with-input-file
-                     (string-append "/proc/" (number->string pid) "/cmdline")
-                   (lambda (port)
-                     (match (string-tokenize (read-string port) %not-nul)
-                       ((argv0 _ ...)
-                        (unless (member (basename argv0) spare)
-                          (syslog "Killing process ~a (~a)~%" pid argv0)
-                          (kill pid SIGKILL)))
-                       (_ #f))))))
-              pids)))
-
 (define (call-with-mnt-container thunk)
   "This is a variant of call-with-container. Run THUNK in a new container
 process, within a separate MNT namespace. The container is not jailed so that