Allow sudo access without a controlling terminal

Ironic setup uses some external scripts that use sudo but they
are not called with a TTY.  This patch allows STACK_USER sudo
access without a controlling terminal.

Change-Id: I0c60fcd5d8418738405d4dd9d08fdf5c8f766829
This commit is contained in:
Adam Gandelman 2014-03-17 16:37:56 -07:00
parent 9f59782a36
commit ea2fcb5538

View File

@ -195,6 +195,7 @@ echo "$STACK_USER ALL=(root) NOPASSWD:ALL" >$TEMPFILE
# Some binaries might be under /sbin or /usr/sbin, so make sure sudo will
# see them by forcing PATH
echo "Defaults:$STACK_USER secure_path=/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin" >> $TEMPFILE
echo "Defaults:$STACK_USER !requiretty" >> $TEMPFILE
chmod 0440 $TEMPFILE
sudo chown root:root $TEMPFILE
sudo mv $TEMPFILE /etc/sudoers.d/50_stack_sh