]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - libexec/rc/rc.d/zpool
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / libexec / rc / rc.d / zpool
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 # PROVIDE: zpool
7 # REQUIRE: hostid disks
8 # BEFORE: mountcritlocal
9 # KEYWORD: nojail
10
11 . /etc/rc.subr
12
13 name="zpool"
14 desc="Import ZPOOLs"
15 rcvar="zfs_enable"
16 start_cmd="zpool_start"
17 required_modules="zfs"
18
19 zpool_start()
20 {
21         local cachefile
22
23         for cachefile in /etc/zfs/zpool.cache /boot/zfs/zpool.cache; do
24                 if [ -r $cachefile ]; then
25                         zpool import -c $cachefile -a -N && break
26                 fi
27         done
28 }
29
30 load_rc_config $name
31 run_rc_command "$1"