aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Thode <[email protected]>2013-11-06 16:56:50 -0600
committerBrian Behlendorf <[email protected]>2013-11-08 10:55:20 -0800
commit760ec997dfde8cf7dcbe1f367456423668e0cf76 (patch)
treede7ce1b550f4f0276ce46231c814811b5590bbb9
parentfd4f76160cb34539f875781fe7f2dea4b937ace5 (diff)
Updating init scripts to have more robust grepping
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 #1837
-rw-r--r--etc/init.d/zfs.fedora.in2
-rw-r--r--etc/init.d/zfs.gentoo.in2
-rw-r--r--etc/init.d/zfs.lsb.in2
-rw-r--r--etc/init.d/zfs.lunar.in2
-rw-r--r--etc/init.d/zfs.redhat.in2
5 files changed, 5 insertions, 5 deletions
diff --git a/etc/init.d/zfs.fedora.in b/etc/init.d/zfs.fedora.in
index 3cece9ba4..178637800 100644
--- a/etc/init.d/zfs.fedora.in
+++ b/etc/init.d/zfs.fedora.in
@@ -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
diff --git a/etc/init.d/zfs.gentoo.in b/etc/init.d/zfs.gentoo.in
index 0034e02ba..01a7731f7 100644
--- a/etc/init.d/zfs.gentoo.in
+++ b/etc/init.d/zfs.gentoo.in
@@ -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()
diff --git a/etc/init.d/zfs.lsb.in b/etc/init.d/zfs.lsb.in
index 0d0ffb4c4..24641485d 100644
--- a/etc/init.d/zfs.lsb.in
+++ b/etc/init.d/zfs.lsb.in
@@ -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()
diff --git a/etc/init.d/zfs.lunar.in b/etc/init.d/zfs.lunar.in
index 3cf79cea0..7a51104c2 100644
--- a/etc/init.d/zfs.lunar.in
+++ b/etc/init.d/zfs.lunar.in
@@ -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
diff --git a/etc/init.d/zfs.redhat.in b/etc/init.d/zfs.redhat.in
index fb5187f05..227787d22 100644
--- a/etc/init.d/zfs.redhat.in
+++ b/etc/init.d/zfs.redhat.in
@@ -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