From d1a77df0e1a8dc89c42cfa3d3d8bd1b1f1ca4ab0 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Mon, 17 Apr 2023 10:58:25 +0200 Subject: [PATCH] updated sudo / su commands (list sudo fist instead of su) --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 49b2bcf..b972c92 100644 --- a/README.md +++ b/README.md @@ -145,9 +145,9 @@ This is only to test whether the service starts successfully. ```shell cd /opt/fastapi-dls/app -su - www-data -c "/opt/fastapi-dls/venv/bin/uvicorn main:app --app-dir=/opt/fastapi-dls/app" +sudo -u www-data /opt/fastapi-dls/venv/bin/uvicorn main:app --app-dir=/opt/fastapi-dls/app # or -sudo -u www-data -c "/opt/fastapi-dls/venv/bin/uvicorn main:app --app-dir=/opt/fastapi-dls/app" +su - www-data -c "/opt/fastapi-dls/venv/bin/uvicorn main:app --app-dir=/opt/fastapi-dls/app" ``` **Create config file** @@ -247,6 +247,8 @@ This is only to test whether the service starts successfully. BASE_DIR=/opt/fastapi-dls SERVICE_USER=dls cd ${BASE_DIR} +sudo -u ${SERVICE_USER} ${BASE_DIR}/venv/bin/uvicorn main:app --app-dir=${BASE_DIR}/app +# or su - ${SERVICE_USER} -c "${BASE_DIR}/venv/bin/uvicorn main:app --app-dir=${BASE_DIR}/app" ```