Skip to content
Snippets Groups Projects
Unverified Commit 873b51b3 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

mapped-devices: Bail out when RAID sources don't show up.

* gnu/system/mapped-devices.scm (open-raid-device): Bail out after 20
loop iterations.
parent 7f8ad82b
No related branches found
No related tags found
No related merge requests found
...@@ -135,12 +135,16 @@ (define (open-raid-device sources target) ...@@ -135,12 +135,16 @@ (define (open-raid-device sources target)
(use-modules (srfi srfi-1) (ice-9 format)) (use-modules (srfi srfi-1) (ice-9 format))
(let ((sources '#$sources)) (let ((sources '#$sources))
(let loop () (let loop ((attempts 0))
(unless (every file-exists? sources) (unless (every file-exists? sources)
(when (> attempts 20)
(error "RAID devices did not show up; bailing out"
sources))
(format #t "waiting for RAID source devices~{ ~a~}...~%" (format #t "waiting for RAID source devices~{ ~a~}...~%"
sources) sources)
(sleep 1) (sleep 1)
(loop))) (loop (+ 1 attempts))))
(zero? (system* (string-append #$mdadm "/sbin/mdadm") (zero? (system* (string-append #$mdadm "/sbin/mdadm")
"--assemble" #$target sources))))) "--assemble" #$target sources)))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment