diff --git a/templates/mongodb-letsencrypt-acmetool.sh.j2 b/templates/mongodb-letsencrypt-acmetool.sh.j2 index 8987d54..4bf9d39 100644 --- a/templates/mongodb-letsencrypt-acmetool.sh.j2 +++ b/templates/mongodb-letsencrypt-acmetool.sh.j2 @@ -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