diff --git a/rocky/Dockerfile b/rocky/Dockerfile index d13f512f702..255f1c43b7f 100644 --- a/rocky/Dockerfile +++ b/rocky/Dockerfile @@ -69,4 +69,4 @@ RUN export SECRET_KEY="secret" BYTES_API="http://bytes:8000" BYTES_PASSWORD="pas USER rocky -CMD ["uwsgi", "--ini", "uwsgi.ini", "--wsgi-file", "rocky/wsgi.py"] +CMD ["granian", "--interface", "wsgi", "rocky.wsgi:application", "--host", "0.0.0.0"] diff --git a/rocky/debian/kat-rocky.service b/rocky/debian/kat-rocky.service index 1430ffa7623..6bebab0c8ba 100644 --- a/rocky/debian/kat-rocky.service +++ b/rocky/debian/kat-rocky.service @@ -9,12 +9,11 @@ SyslogIdentifier=kat-rocky WorkingDirectory=/opt/venvs/kat-rocky/ EnvironmentFile=/usr/lib/kat/rocky.defaults EnvironmentFile=/etc/kat/rocky.conf -ExecStart=/opt/venvs/kat-rocky/bin/uwsgi --ini /etc/kat/rocky.uwsgi.ini +ExecStart=/opt/venvs/kat-rocky/bin/granian --interface wsgi rocky.wsgi:application Restart=on-failure RestartSec=3s KillSignal=SIGQUIT KillMode=mixed -Type=notify NotifyAccess=all [Install] diff --git a/rocky/debian/postinst b/rocky/debian/postinst index c7dbaad5496..6a616d82503 100755 --- a/rocky/debian/postinst +++ b/rocky/debian/postinst @@ -9,19 +9,14 @@ if [ "$1" = "configure" ]; then # Set SECRET_KEY if empty key=$(tr -dc A-Za-z0-9 < /dev/urandom | head -c 64) sed -i "s/SECRET_KEY= *\$/SECRET_KEY=${key}/" /etc/kat/rocky.conf - - # Only configure granian for new installs. Existing installations will - # switch in the next release. - mkdir -p /etc/systemd/system/kat-rocky.service.d - cat > /etc/systemd/system/kat-rocky.service.d/use-granian.conf << EOF -# Do not customize this file because it will be automatically removed in the next release -[Service] -ExecStart= -ExecStart=/opt/venvs/kat-rocky/bin/granian --interface wsgi rocky.wsgi:application -Type=simple -EOF fi + # Delete file and directory that was added in 1.13 to use granian only on + # new installs. + if [ -d /etc/systemd/system/kat-rocky.service.d ]; then + rm -f /etc/systemd/system/kat-rocky.service.d/use-granian.conf + rmdir --ignore-fail-on-non-empty /etc/systemd/system/kat-rocky.service.d + fi fi #DEBHELPER# diff --git a/rocky/entrypoint.sh b/rocky/entrypoint.sh index a4f25616119..54687790413 100755 --- a/rocky/entrypoint.sh +++ b/rocky/entrypoint.sh @@ -8,8 +8,4 @@ if [ "$DATABASE_MIGRATION" = "1" ] || [[ $DATABASE_MIGRATION == "true" ]]; then python manage.py migrate --noinput fi -if [ "$1" == "uwsgi" ] && { [ "$USE_GRANIAN" = "1" ] || [[ $USE_GRANIAN == "true" ]]; }; then - exec granian --interface wsgi rocky.wsgi:application --host 0.0.0.0 -else - exec "$@" -fi +exec "$@"