diff --git a/setup/start.sh b/setup/start.sh index 49c75e714..773423528 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -212,6 +212,12 @@ mkdir -p "${DATA_DIR}/nginx/applications" mkdir -p "${DATA_DIR}/nginx/cert" cp "${script_dir}/start/nginx/nginx.conf" "${DATA_DIR}/nginx/nginx.conf" cp "${script_dir}/start/nginx/mime.types" "${DATA_DIR}/nginx/mime.types" +if ! grep "^Restart=" /etc/systemd/system/multi-user.target.wants/nginx.service; then + # default nginx service file does not restart on crash + echo -e "\n[Service]\nRestart=always\n" >> /etc/systemd/system/multi-user.target.wants/nginx.service + systemctl daemon-reload +fi +systemctl start nginx # bookkeep the version as part of data echo "{ \"version\": \"${arg_version}\", \"boxVersionsUrl\": \"${arg_box_versions_url}\" }" > "${BOX_DATA_DIR}/version"