summaryrefslogtreecommitdiffstats
path: root/etc/init.d/zfs-import.in
diff options
context:
space:
mode:
authorTurbo Fredriksson <[email protected]>2015-09-22 09:56:28 +0200
committerBrian Behlendorf <[email protected]>2015-09-29 11:42:24 -0700
commit57732964d35616d6c93b8377b1ed72c485d9d73d (patch)
treedb0d1ab021f7972f451dab29e714a8a797c899cc /etc/init.d/zfs-import.in
parent45838e3a414a7a1a5fb49dc528dee1d22449599b (diff)
Init script fixes
* Fix regression - "OVERLAY_MOUNTS" should have been "DO_OVERLAY_MOUNTS". * Fix update-rc.d commands in postinst. Thanx to subzero79@GitHub. * Fix make sure a filesystem exists before trying to mount in mount_fs() * Fix local variable usage. * Fix to read_mtab(): * Strip control characters (space - \040) from /proc/mounts GLOBALY, not just first occurrence. * Don't replace unprintable characters ([/-. ]) for use in the variable name with underscore. No need, just remove them all together. * Add check_boolean() to check if a user configure option is set ('yes', 'Yes', 'YES' or any combination there of) OR '1'. Anything else is considered 'unset'. * Add a ZFS_POOL_IMPORT to the default config. * This is a semi colon separated list of pools to import ONLY. * This is intended for systems which have _a lot_ of pools (from a SAN for example) and it would be to many to put in the ZFS_POOL_EXCEPTIONS variable.. * Add a config option "ZPOOL_IMPORT_OPTS" for adding additional options to "zpool import". * Add documentation and the chance of overriding the ZPOOL_CACHE variable in the config file. * Remove "sort" from find_pools() and setup_snapshot_booting(). Sometimes not available, and not really necessary. Signed-off-by: Turbo Fredriksson <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Ned Bass <[email protected]> Issue #3816
Diffstat (limited to 'etc/init.d/zfs-import.in')
-rwxr-xr-xetc/init.d/zfs-import.in21
1 files changed, 10 insertions, 11 deletions
diff --git a/etc/init.d/zfs-import.in b/etc/init.d/zfs-import.in
index a3d6c1442..5e2192963 100755
--- a/etc/init.d/zfs-import.in
+++ b/etc/init.d/zfs-import.in
@@ -209,7 +209,7 @@ do_import()
# Import by using ZPOOL_IMPORT_PATH (either set above or in
# the config file) _or_ with the 'built in' default search
# paths. This is the prefered way.
- "$ZPOOL" import -N "$pool" 2> /dev/null
+ "$ZPOOL" import -N ${ZPOOL_IMPORT_OPTS} "$pool" 2> /dev/null
r="$?" ; RET=$((RET + r))
if [ "$r" -eq 0 ]
then
@@ -224,13 +224,14 @@ do_import()
if [ "$r" -gt 0 -a -f "$ZPOOL_CACHE" ]
then
# Failed to import without a cache file. Try WITH...
- if [ -z "$init" -a "$VERBOSE_MOUNT" = 'yes' ]
+ if [ -z "$init" ] && check_boolean "$VERBOSE_MOUNT"
then
# Interactive + Verbose = more information
zfs_log_progress_msg " using cache file"
fi
- "$ZPOOL" import -c "$ZPOOL_CACHE" -N "$pool" 2> /dev/null
+ "$ZPOOL" import -c "$ZPOOL_CACHE" -N ${ZPOOL_IMPORT_OPTS} \
+ "$pool" 2> /dev/null
r="$?" ; RET=$((RET + r))
if [ "$r" -eq 0 ]
then
@@ -295,26 +296,24 @@ do_status()
do_start()
{
- if [ "$VERBOSE_MOUNT" = 'yes' ]
+ if check_boolean "$VERBOSE_MOUNT"
then
zfs_log_begin_msg "Checking if ZFS userspace tools present"
fi
if checksystem
then
- [ "$VERBOSE_MOUNT" = 'yes' ] && zfs_log_end_msg 0
+ check_boolean "$VERBOSE_MOUNT" && zfs_log_end_msg 0
- if [ "$VERBOSE_MOUNT" = 'yes' ]
- then
- zfs_log_begin_msg "Loading kernel ZFS infrastructure"
- fi
+ check_boolean "$VERBOSE_MOUNT" && \
+ zfs_log_begin_msg "Loading kernel ZFS infrastructure"
if ! load_module "zfs"
then
- [ "$VERBOSE_MOUNT" = 'yes' ] && zfs_log_end_msg 1
+ check_boolean "$VERBOSE_MOUNT" && zfs_log_end_msg 1
return 5
fi
- [ "$VERBOSE_MOUNT" = 'yes' ] && zfs_log_end_msg 0
+ check_boolean "$VERBOSE_MOUNT" && zfs_log_end_msg 0
do_import && udev_trigger # just to make sure we get zvols.