We need to add the sbin paths to the secure path in sudoers for the user
running the script, to make sure that running sbin binaries from sudo
will work.
Change-Id: I7942407df768bfa8dd035f15fa8b43ba05319779
| ... | ... |
@@ -193,6 +193,9 @@ else |
| 193 | 193 |
# Set up devstack sudoers |
| 194 | 194 |
TEMPFILE=`mktemp` |
| 195 | 195 |
echo "`whoami` ALL=(root) NOPASSWD:ALL" >$TEMPFILE |
| 196 |
+ # Some binaries might be under /sbin or /usr/sbin, so make sure sudo will |
|
| 197 |
+ # see them by forcing PATH |
|
| 198 |
+ echo "Defaults:`whoami` secure_path=/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin" >> $TEMPFILE |
|
| 196 | 199 |
chmod 0440 $TEMPFILE |
| 197 | 200 |
sudo chown root:root $TEMPFILE |
| 198 | 201 |
sudo mv $TEMPFILE /etc/sudoers.d/50_stack_sh |