Skip to content

Commit

Permalink
Updating init scripts to have more robust grepping
Browse files Browse the repository at this point in the history
The previous pattern could accidentally match on things like
'real_root=ZFS=node02-zp00/ROOT/rootfs' due to the 'ZFS=no'
substring.

Signed-off-by: Matthew Thode <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#1837
  • Loading branch information
prometheanfire authored and behlendorf committed Nov 8, 2013
1 parent fd4f761 commit 760ec99
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion etc/init.d/zfs.fedora.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export PATH=/usr/local/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin

if [ -z "$init" ]; then
# Not interactive
grep -Eqi 'zfs=off|zfs=no' /proc/cmdline && exit 3
grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3
fi

# Source function library & LSB routines
Expand Down
2 changes: 1 addition & 1 deletion etc/init.d/zfs.gentoo.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

if [ -z "$init" ]; then
# Not interactive
grep -Eqi 'zfs=off|zfs=no' /proc/cmdline && exit 3
grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3
fi

depend()
Expand Down
2 changes: 1 addition & 1 deletion etc/init.d/zfs.lsb.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"

if [ -z "$init" ]; then
# Not interactive
grep -Eqi 'zfs=off|zfs=no' /proc/cmdline && exit 3
grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3
fi

start()
Expand Down
2 changes: 1 addition & 1 deletion etc/init.d/zfs.lunar.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"

if [ -z "$init" ]; then
# Not interactive
grep -Eqi 'zfs=off|zfs=no' /proc/cmdline && exit 3
grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3
fi

case $1 in
Expand Down
2 changes: 1 addition & 1 deletion etc/init.d/zfs.redhat.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export PATH=/usr/local/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin

if [ -z "$init" ]; then
# Not interactive
grep -Eqi 'zfs=off|zfs=no' /proc/cmdline && exit 3
grep -qE '(^|[^\\](\\\\)* )zfs=(off|no)( |$)' /proc/cmdline && exit 3
fi

# Source function library & LSB routines
Expand Down

0 comments on commit 760ec99

Please sign in to comment.