From 26fa31af17d0128463547a7f7d73ddfb79d8ce2d Mon Sep 17 00:00:00 2001 From: Mitko Haralanov Date: Fri, 10 Jan 2014 11:41:28 -0500 Subject: [PATCH] truescale.cmds: Wait for /dev/ipath* devices before changing permissions Wait for up to 30 seconds for the /dev/ipath* devices to appear before attempting to change their permissions. This helps with system which boot a bit slower on which the device permissions could be left in the wrong state. Signed-off-by: Mitko Haralanov --- ofed_scripts/truescale.cmds | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/ofed_scripts/truescale.cmds b/ofed_scripts/truescale.cmds index 0f445fe..d96147e 100644 --- a/ofed_scripts/truescale.cmds +++ b/ofed_scripts/truescale.cmds @@ -306,9 +306,17 @@ start) mount -t ipathfs none /ipathfs # make sure /dev/ipath files get created with correct permissions - if [ ! -c /dev/ipath ]; then sleep 2; fi - if [ ! -c /dev/ipath ]; then sleep 3; fi - chmod 666 /dev/ipath /dev/ipath[0-9]* >/dev/null 2>&1 + typeset -i timeout=30 count=0 + while [ $((count++)) -lt $timeout ]; do + if [ -c /dev/ipath ]; then + chmod 666 /dev/ipath /dev/ipath[0-9]* >/dev/null 2>&1 + break + fi + sleep 1 + done + if [ $count -ge $timeout ]; then + warn_and_log Failed to modify permissions on /dev/ipath\* files + fi set_irq_affinity ;; -- 2.41.0