Use the upstart commands on old ubuntu.

This commit is contained in:
Andrea Dell'Amico 2022-09-13 13:27:08 +02:00
parent 84b92decb4
commit 91b925a0e8
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 9 additions and 3 deletions

View File

@ -28,9 +28,15 @@ chgrp mongodb ${MONGODB_CERTFILE}
{% if mongodb_ssl_enabled %}
echo "Restart the mongod service, reload is not supported" >> "$LE_LOG_DIR/mongodb.log"
{% if mongodb_install_from_external_repo %}
service mongod stop >> "$LE_LOG_DIR/mongodb.log" 2>&1
sleep 10
service mongod start >> "$LE_LOG_DIR/mongodb.log" 2>&1
if [ -x /sbin/stop ] && [ -f /etc/init/mongod.conf ] ; then
/sbin/stop mongod >> "$LE_LOG_DIR/mongodb.log" 2>&1
sleep 10
/sbin/start mongod >> "$LE_LOG_DIR/mongodb.log" 2>&1
else
service mongod stop >> "$LE_LOG_DIR/mongodb.log" 2>&1
sleep 10
service mongod start >> "$LE_LOG_DIR/mongodb.log" 2>&1
fi
{% else %}
systemctl stop mongodb >> "$LE_LOG_DIR/mongodb.log" 2>&1
sleep 10