This fixes a race condition in sudo where it would log a log of
error messages to syslog if used while we're running the install
script: files around sudoers.d/ are then moved around, and it'll
yell for each file it previously listed if the file no longer
exists when it tries to stat() it. It also deprecates the --no-wait
flag of the install script, as now the sudoers.d/ directory will
always have integrity at all times.
Signed-off-by: Stéphane Lesimple <stephane.lesimple+bastion@ovhcloud.com>
pull/138/head
Stéphane Lesimple5 years agocommitted byStéphane Lesimple
action_doing "Removing obsolete sudoers.d files if any..."
nbtoremove=$(wc -l < "$oldsudoers")
if [ "$nbtoremove" = 0 ]; then
action_na
else
for toremove in $(< "$oldsudoers")
do
action_detail "removing $toremove"
rm -f "$toremove"
done
action_done "removed $nbtoremove obsolete files"
fi
rm -f "$oldsudoers"
# create the bastionsync account (needed for master/slave)
action_doing "Creating the bastionsync account"
@ -1334,11 +1366,11 @@ fi
if [ "${opt[check-ttyrec]}" = 1 ] ; then
action_doing "Checking ttyrec version"
if ! command -v ttyrec >/dev/null 2>&1; then
action_error "ttyrec is not installed, the bastion will not work! Please either install ovh-ttyrec (/opt/bastion/bin/admin/install-ttyrec.sh) or run this script a second time with \`$0 --nothing --no-wait --install-fake-ttyrec'"
action_error "ttyrec is not installed, the bastion will not work! Please either install ovh-ttyrec (/opt/bastion/bin/admin/install-ttyrec.sh) or run this script a second time with \`$0 --nothing --install-fake-ttyrec'"
action_error "Incompatible ttyrec version installed, the bastion will not work! Please either install ovh-ttyrec (/opt/bastion/bin/admin/install-ttyrec.sh) or run this script again with \`$0 --nothing --no-wait --install-fake-ttyrec'"
action_error "Incompatible ttyrec version installed, the bastion will not work! Please either install ovh-ttyrec (/opt/bastion/bin/admin/install-ttyrec.sh) or run this script again with \`$0 --nothing --install-fake-ttyrec'"