From 78e41fb517a63c4a9cc225975e4714f84918149d Mon Sep 17 00:00:00 2001 From: Bob Gilligan Date: Wed, 29 Oct 2008 16:32:30 -0700 Subject: Bugfix: 3841: Allow admin level users to run the RAID op mode commands. --- templates/remove/raid/node.tag/member/node.tag/node.def | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'templates/remove') diff --git a/templates/remove/raid/node.tag/member/node.tag/node.def b/templates/remove/raid/node.tag/member/node.tag/node.def index d384fd3..a48fd4a 100644 --- a/templates/remove/raid/node.tag/member/node.tag/node.def +++ b/templates/remove/raid/node.tag/member/node.tag/node.def @@ -20,14 +20,16 @@ run: echo "actual members are: $membership" elif [ "$num_members" -eq "1" ]; then echo "Can't remove last member of a RAID set" + elif [ ! -r /dev/$raid_set ]; then + echo "Must be admin or root to remove RAID set member" else echo "removing member $member from RAID set $raid_set" - mdadm /dev/$raid_set --fail /dev/$member_to_remove + sudo /sbin/mdadm /dev/$raid_set --fail /dev/$member_to_remove if [ $? -ne 0 ]; then echo "Unable to mark member as failed" else sleep 1 - mdadm /dev/$raid_set --remove /dev/$member_to_remove + sudo /sbin/mdadm /dev/$raid_set --remove /dev/$member_to_remove if [ $? -ne 0 ]; then echo "Unable to remove member from RAID set" fi -- cgit v1.2.3