summaryrefslogtreecommitdiff
path: root/ezjail.sh
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2006-05-04 18:49:52 +0000
committererdgeist <erdgeist@erdgeist.org>2006-05-04 18:49:52 +0000
commit89a8a70f026a6d0a4bec498e830aabdd7d8025b5 (patch)
tree73da9a9d21735e5baa5571f2f4cc3a0f90df60e3 /ezjail.sh
parent63ad46a47880b2f9d11c9d25317e5c1364dcc450 (diff)
Flag jails that would interrupt boot process as attachblocking. Skip or choose them deliberately in ezjail.sh
Diffstat (limited to 'ezjail.sh')
-rwxr-xr-xezjail.sh19
1 files changed, 8 insertions, 11 deletions
diff --git a/ezjail.sh b/ezjail.sh
index dbf78ca..5db8acc 100755
--- a/ezjail.sh
+++ b/ezjail.sh
@@ -62,19 +62,16 @@ do_cmd()
62 eval ezjail_image=\"\$jail_${ezjail}_image\" 62 eval ezjail_image=\"\$jail_${ezjail}_image\"
63 eval ezjail_imagetype=\"\$jail_${ezjail}_imagetype\" 63 eval ezjail_imagetype=\"\$jail_${ezjail}_imagetype\"
64 eval ezjail_attachparams=\"\$jail_${ezjail}_attachparams\" 64 eval ezjail_attachparams=\"\$jail_${ezjail}_attachparams\"
65 eval ezjail_attachblocking=\"\$jail_${ezjail}_attachblocking\"
65 66
66 # Cannot auto mount crypto jails without interrupting boot process 67 # Cannot auto mount blocking crypto jails without interrupting boot process
67 if [ "${ezjail_fromrc}" = "YES" -a "${action}" = "start" ]; then 68 [ "${ezjail_fromrc}" = "YES" -a "${action}" = "start" && "${ezjail_attachblocking}" = "YES" ] && continue
68 case "${ezjail_imagetype}" in crypto|eli|bde) continue;; esac
69 fi
70 69
71 # Explicitely do only run crypto jails when *crypto is requested 70 # Explicitely do only run blocking crypto jails when *crypto is requested
72 if [ "${action%crypto}" != "${action}" ]; then 71 [ "${action%crypto}" != "${action}" -a -z "${ezjail_attachblocking}" ] && continue
73 case "${ezjail_imagetype}" in crypto|eli|bde) ;; *) continue;; esac
74 fi
75 72
76 # Try to attach (crypto) devices 73 # Try to attach (crypto) devices
77 [ "${ezjail_image}" ] && attach_detach_pre 74 [ -n "${ezjail_image}" ] && attach_detach_pre
78 75
79 ezjail_pass="${ezjail_pass} ${ezjail}" 76 ezjail_pass="${ezjail_pass} ${ezjail}"
80 done 77 done
@@ -100,13 +97,13 @@ attach_detach_pre ()
100 # this is. In this case, the device to mount is 97 # this is. In this case, the device to mount is
101 case ${ezjail_imagetype} in 98 case ${ezjail_imagetype} in
102 crypto|bde) 99 crypto|bde)
103 echo "Attaching gbde device for image jail ${ezjail}..." 100 echo "Attaching bde device for image jail ${ezjail}..."
104 echo gbde attach /dev/${ezjail_device} ${ezjail_attachparams} | /bin/sh 101 echo gbde attach /dev/${ezjail_device} ${ezjail_attachparams} | /bin/sh
105 # Device to mount is not md anymore 102 # Device to mount is not md anymore
106 ezjail_device=${ezjail_device}.bde 103 ezjail_device=${ezjail_device}.bde
107 ;; 104 ;;
108 eli) 105 eli)
109 echo "Attaching gbde device for image jail ${ezjail}..." 106 echo "Attaching eli device for image jail ${ezjail}..."
110 echo geli attach ${ezjail_attachparams} /dev/${ezjail_device} | /bin/sh 107 echo geli attach ${ezjail_attachparams} /dev/${ezjail_device} | /bin/sh
111 # Device to mount is not md anymore 108 # Device to mount is not md anymore
112 ezjail_device=${ezjail_device}.eli 109 ezjail_device=${ezjail_device}.eli