<div dir="ltr"><div>Package: cryptsetup <br>Version: 2:1.6.6-5<br><br><br>Description:<br>When shutting down Debian Stretch with full disk encryption, an error message appears:<br><br>Stopping remaining crypto disks<br>sda2_crypt (busy)...<br><br>and the shutdown process hangs <br><br>it is a crypto testing setup, with /var & /home on separate encrypted partitions(no LVM), <br>with their keys stored on root partition. During shutdown /lib/cryptsetup/cryptdisks.functions<br>does one pass on parsing crypttab and it's done. <br><br></div>System:<br><br>Debian GNU/Linux stretch/sid<br>Kernel: 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1 (2015-05-24) x86_64 GNU/Linux<br>Libc:   Debian GLIBC 2.19-18 <br><br><div><br>I made a patch, that works for me (feel free to improve on it) <br><br><br>diff /lib/cryptsetup/cryptdisks.functions.orig /lib/cryptsetup/cryptdisks.functions.new<br>675a676,677<br>>       elif [ "$INITSTATE" = "remaining" ]; then <br>>          return 2<br>770,774c772,790<br>< <br><    egrep -v "^[[:space:]]*(#|$)" "$TABFILE" | while read dst src key opts; do<br><       handle_crypttab_line_stop "$dst" "$src" "$key" "$opts" <&3 || log_action_end_msg $?<br><    done 3<&1<br>< <br>---<br>>    #BUGFIX<br>>    ITERATE=1<br>>    while [ "$ITERATE" = "1" ]; do <br>>       egrep -v "^[[:space:]]*(#|$)" "$TABFILE" | while read dst src key opts; do<br>>       handle_crypttab_line_stop "$dst" "$src" "$key" "$opts" <&3 <br>>       STATE=$?<br>>       if [ "$STATE" = "0" ]; then <br>>          echo "stopped $dst"<br>>          ITERATE=0<br>>       elif [ "$STATE" = "1" ]; then<br>>          log_action_end_msg $?<br>>          ITERATE=0<br>>       elif [ "$STATE" = "2" ]; then<br>>          echo "$dst Busy. Retrying..."<br>>          sleep 1<br>>          ITERATE=1<br>>       fi <br>>       done 3<&1<br>>    done <br><br><br></div><div><br></div><div><br></div></div>