Avoid using sudo in non-interactive execution

By default, sudoers has "requiretty" settings. So it will report
the following error when run sudo in non-interactive script:

sudo: sorry, you must have a tty to run sudo

Actually for the operation on journald.conf in $STAGING_DIR doesn't
require sudo. So let's run it without sudo.

Change-Id: Iea8132f329af122c10d963b88f1aa03814da6593
This commit is contained in:
Jianghua Wang 2017-08-11 03:20:44 +00:00
parent ca220e8e11
commit 0ce6489379
1 changed files with 1 additions and 1 deletions

View File

@ -296,7 +296,7 @@ cp_it ~/.bashrc $STAGING_DIR/opt/stack/.bashrc
# deleting older logs that may be important to the job.
JOURNALD_CFG=$STAGING_DIR/etc/systemd/journald.conf
if [ -f $JOURNALD_CFG ] ; then
sudo sed -i -e 's/#Storage=auto/Storage=persistent/' $JOURNALD_CFG
sed -i -e 's/#Storage=auto/Storage=persistent/' $JOURNALD_CFG
fi
# Configure run.sh