Browse code

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

Adam Gandelman authored on 2014/03/18 08:37:56
Showing 1 changed files
... ...
@@ -195,6 +195,7 @@ echo "$STACK_USER ALL=(root) NOPASSWD:ALL" >$TEMPFILE
195 195
 # Some binaries might be under /sbin or /usr/sbin, so make sure sudo will
196 196
 # see them by forcing PATH
197 197
 echo "Defaults:$STACK_USER secure_path=/sbin:/usr/sbin:/usr/bin:/bin:/usr/local/sbin:/usr/local/bin" >> $TEMPFILE
198
+echo "Defaults:$STACK_USER !requiretty" >> $TEMPFILE
198 199
 chmod 0440 $TEMPFILE
199 200
 sudo chown root:root $TEMPFILE
200 201
 sudo mv $TEMPFILE /etc/sudoers.d/50_stack_sh