Skip to content

Commit

Permalink
* Change the order of the function library check/load.
Browse files Browse the repository at this point in the history
  Redhat based system _can_ have a /lib/lsb/init-functions file (from
  the redhat-lsb-core package), but it's only partially what we can use.
  Instead, look for that file last, giving the script a chance to catch
  the 'real' distribution file.
* Filter out dashes in dataset name in read_mtab().

Signed-off-by: Turbo Fredriksson [email protected]
Closes openzfs#3463
  • Loading branch information
FransUrbo committed Jun 2, 2015
1 parent 2a34db1 commit c1771a8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions etc/init.d/zfs-functions.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
PATH=/sbin:/bin:/usr/bin:/usr/sbin

# Source function library
if [ -f /lib/lsb/init-functions ]; then
# LSB, Debian GNU/Linux and derivates
. /lib/lsb/init-functions
elif [ -f /etc/rc.d/init.d/functions ]; then
if [ -f /etc/rc.d/init.d/functions ]; then
# RedHat and derivates
. /etc/rc.d/init.d/functions
elif [ -L /etc/init.d/functions.sh ]; then
# Gentoo
. /etc/init.d/functions.sh
elif [ -f /lib/lsb/init-functions ]; then
# LSB, Debian GNU/Linux and derivates
. /lib/lsb/init-functions
fi

# Of course the functions we need are called differently
Expand Down Expand Up @@ -373,7 +373,8 @@ read_mtab()

while read -r fs mntpnt fstype opts rest; do
if echo "$fs $mntpnt $fstype $opts" | grep -qE "$match"; then
mntpnt=$(printf '%b\n' "$mntpnt" | sed 's,/,_,g')
mntpnt=$(printf '%b\n' "$mntpnt" | sed -e 's,/,_,g' \
-e 's,-,_,g')
eval export MTAB_$mntpnt="$fs"
fi
done < /proc/mounts
Expand Down

0 comments on commit c1771a8

Please sign in to comment.