fixed MongoDB diagnostics disabling (added missing sudo)

This commit is contained in:
Axel Uhl
2026-02-02 16:14:13 +01:00
parent 03f61b3a39
commit 7ed24638ec
2 changed files with 3 additions and 2 deletions
@@ -456,11 +456,12 @@ EOF
if ! grep "logRotate: reopen" /etc/mongod.conf; then
sudo sed -i -e 's/^ logAppend: true/ logAppend: true\n logRotate: reopen/' /etc/mongod.conf
fi
cat >>/etc/mongod.conf << EOF
sudo su - -c "cat >>/etc/mongod.conf << EOF
# Disable FTDC to avoid crashes
setParameter:
diagnosticDataCollectionEnabled: false
EOF
"
}
# Copies the /root/secrets and /root/mail.properties file to the local instance, ensuring only root can read it
@@ -32,7 +32,7 @@ else
sudo mv imageupgrade_functions.sh /usr/local/bin
# build-crontab
. imageupgrade_functions.sh
# Install MongoDB 5.0 and configure as replica set "replica"
# Install MongoDB 7.0 and configure as replica set "replica"
setup_mongo_7_0_on_AL2023
sudo su - -c "cat << EOF >>/etc/mongod.conf
replication: