diff options
author | Bob Gilligan <gilligan@vyatta.com> | 2008-10-29 16:32:30 -0700 |
---|---|---|
committer | Bob Gilligan <gilligan@vyatta.com> | 2008-10-29 16:32:30 -0700 |
commit | 78e41fb517a63c4a9cc225975e4714f84918149d (patch) | |
tree | 5a490f5f62b8be03c18b230e50bb1f7c327d86a5 /templates/remove | |
parent | 5304fabe0b0eb212936ca1f47e4cf98d73fd6b81 (diff) | |
download | vyatta-op-78e41fb517a63c4a9cc225975e4714f84918149d.tar.gz vyatta-op-78e41fb517a63c4a9cc225975e4714f84918149d.zip |
Bugfix: 3841: Allow admin level users to run the RAID op mode commands.
Diffstat (limited to 'templates/remove')
-rw-r--r-- | templates/remove/raid/node.tag/member/node.tag/node.def | 6 |
1 files changed, 4 insertions, 2 deletions
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 |