@@ -16,6 +16,8 @@ devlist=
# For example, /dev/md0 is created, stops it, then assemble it, the
# device node will be /dev/md127 (127 is choosed by mdadm autumatically)
is_foreign="no"
+#disable selinux
+sys_selinux="Permissive"
skipping_linear="no"
skipping_multipath="no"
@@ -351,6 +353,7 @@ main() {
fi
done
+ restore_selinux
exit 0
}
@@ -167,6 +167,15 @@ is_raid_foreign() {
fi
}
+record_selinux() {
+ sys_selinux=`getenforce`
+ setenforce Permissive
+}
+
+restore_selinux() {
+ setenforce $sys_selinux
+}
+
do_setup() {
trap cleanup 0 1 3 15
trap ctrl_c 2
@@ -247,6 +256,7 @@ do_setup() {
echo 0 > /sys/module/md_mod/parameters/start_ro
record_system_speed_limit
is_raid_foreign
+ record_selinux
}
# check various things
Sometimes systemd service fails because selinux. Disable selinux during testing now. We can enable it in future when having a better method. Signed-off-by: Xiao Ni <xni@redhat.com> --- test | 3 +++ tests/func.sh | 10 ++++++++++ 2 files changed, 13 insertions(+)