summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri John Ledkov <xnox@ubuntu.com>2018-07-23 11:48:24 +0100
committerDimitri John Ledkov <xnox@ubuntu.com>2018-07-23 11:49:01 +0100
commit88ee7cfa1e00aabcfc8f48b57f4b226e7b5c2158 (patch)
treeec4d2bad4813bab7321ab5094c479dfc9c585de4
parent3bed5265f9c792edfcd593eeaa93675711e5e264 (diff)
Make safe-timouts udev rules compatible with usr-split systems.debian/4.1_rc1-4archive/debian/4.1_rc1-4
-rw-r--r--debian/changelog5
-rw-r--r--debian/patches/0001-udev.rules-make-safe-timeouts-compatible-with-split-.patch33
-rw-r--r--debian/patches/series1
-rw-r--r--udev-md-raid-safe-timeouts.rules4
4 files changed, 39 insertions, 4 deletions
diff --git a/debian/changelog b/debian/changelog
index bd7e75a..b511086 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,9 @@
-mdadm (4.1~rc1-4) UNRELEASED; urgency=medium
+mdadm (4.1~rc1-4) unstable; urgency=medium
* Cherrypick master patches up to 20th of July 2018. LP: #1781427
+ * Make safe-timouts udev rules compatible with usr-split systems.
- -- Dimitri John Ledkov <xnox@ubuntu.com> Mon, 23 Jul 2018 11:40:06 +0100
+ -- Dimitri John Ledkov <xnox@ubuntu.com> Mon, 23 Jul 2018 11:48:50 +0100
mdadm (4.1~rc1-3) unstable; urgency=medium
diff --git a/debian/patches/0001-udev.rules-make-safe-timeouts-compatible-with-split-.patch b/debian/patches/0001-udev.rules-make-safe-timeouts-compatible-with-split-.patch
new file mode 100644
index 0000000..13613ef
--- /dev/null
+++ b/debian/patches/0001-udev.rules-make-safe-timeouts-compatible-with-split-.patch
@@ -0,0 +1,33 @@
+From 5ebc0b0d96e740bfaa0b514ad25425f84868328a Mon Sep 17 00:00:00 2001
+From: Dimitri John Ledkov <xnox@ubuntu.com>
+Date: Mon, 23 Jul 2018 11:43:04 +0100
+Subject: [PATCH] udev.rules: make safe timeouts compatible with split-usr
+ systems.
+
+Instead of /usr/bin/sh, and /usr/bin/echo, use /bin/sh and shell
+built-in echo respectively. This makes
+udev-md-raid-safe-timeouts.rules to be compatible with both usr-merged
+and split-usr systems alike.
+
+Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
+---
+ udev-md-raid-safe-timeouts.rules | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/udev-md-raid-safe-timeouts.rules b/udev-md-raid-safe-timeouts.rules
+index 420c8626..13c23d84 100644
+--- a/udev-md-raid-safe-timeouts.rules
++++ b/udev-md-raid-safe-timeouts.rules
+@@ -55,7 +55,7 @@ ACTION=="add|change", \
+ ENV{MD_LEVEL}=="raid[1-9]*", \
+ TEST=="/sys/block/$parent/device/timeout", \
+ TEST=="/usr/sbin/smartctl", \
+- PROGRAM!="/usr/bin/sh -c '/usr/sbin/smartctl -l scterc /dev/$parent | grep -q seconds && exit 0 || exit 1'", \
+- RUN+="/usr/bin/sh -c '/usr/bin/echo 180 > /sys/block/$parent/device/timeout && /usr/bin/logger timeout for /dev/$parent set to 180 secs'"
++ PROGRAM!="/bin/sh -c '/usr/sbin/smartctl -l scterc /dev/$parent | grep -q seconds && exit 0 || exit 1'", \
++ RUN+="/bin/sh -c 'echo 180 > /sys/block/$parent/device/timeout && /usr/bin/logger timeout for /dev/$parent set to 180 secs'"
+
+ LABEL="md_timeouts_end"
+--
+2.17.1
+
diff --git a/debian/patches/series b/debian/patches/series
index 1bd818d..60f1eed 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -43,3 +43,4 @@ debian-no-Werror.diff
sha1-includes.diff
readlink-path.patch
mdmonitor-service-simplify.diff
+0001-udev.rules-make-safe-timeouts-compatible-with-split-.patch
diff --git a/udev-md-raid-safe-timeouts.rules b/udev-md-raid-safe-timeouts.rules
index 420c862..13c23d8 100644
--- a/udev-md-raid-safe-timeouts.rules
+++ b/udev-md-raid-safe-timeouts.rules
@@ -55,7 +55,7 @@ ACTION=="add|change", \
ENV{MD_LEVEL}=="raid[1-9]*", \
TEST=="/sys/block/$parent/device/timeout", \
TEST=="/usr/sbin/smartctl", \
- PROGRAM!="/usr/bin/sh -c '/usr/sbin/smartctl -l scterc /dev/$parent | grep -q seconds && exit 0 || exit 1'", \
- RUN+="/usr/bin/sh -c '/usr/bin/echo 180 > /sys/block/$parent/device/timeout && /usr/bin/logger timeout for /dev/$parent set to 180 secs'"
+ PROGRAM!="/bin/sh -c '/usr/sbin/smartctl -l scterc /dev/$parent | grep -q seconds && exit 0 || exit 1'", \
+ RUN+="/bin/sh -c 'echo 180 > /sys/block/$parent/device/timeout && /usr/bin/logger timeout for /dev/$parent set to 180 secs'"
LABEL="md_timeouts_end"