From 027237c1c61acd5bd4ca863aaaddd78d5a953127 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 17 Aug 2021 12:18:42 +0200 Subject: [PATCH] =?UTF-8?q?am=C3=A9liore=20check=5Fcreate=5Fscodoc=5Fuser?= =?UTF-8?q?=20pour=20set=20-e=20(contrib=20JMP)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/config.sh | 2 +- tools/install_debian11.sh | 4 ++-- tools/utils.sh | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/config.sh b/tools/config.sh index 5dec59be..d33b07f6 100644 --- a/tools/config.sh +++ b/tools/config.sh @@ -38,7 +38,7 @@ export SCODOC_DB_TEST="SCODOC_TEST" # psql command: if various versions installed, force the one we want: -if [ "${debian_version}" = "10" ] +if [ "${debian_version}" = "11" ] then PSQL=/usr/lib/postgresql/11/bin/psql export POSTGRES_SERVICE="postgresql@11-main.service" diff --git a/tools/install_debian11.sh b/tools/install_debian11.sh index 6dab18ed..55d2342f 100755 --- a/tools/install_debian11.sh +++ b/tools/install_debian11.sh @@ -21,7 +21,7 @@ check_uid_root "$0" cd "$SCODOC_DIR" || die "can't cd $SCODOC_DIR" # ------------ Safety checks -if [ "${debian_version}" != "10" ] +if [ "${debian_version}" != "11" ] then echo "Version du systeme Linux Debian incompatible" exit 1 @@ -70,7 +70,7 @@ python3 -m venv venv || die "can't create Python 3 virtualenv" # ------------ INSTALL DES PAQUETS PYTHON (3.7) # ScoDoc8 uses pip in our env source venv/bin/activate -pip install --upgrade pip +# pip install --upgrade pip => bug [Errno 39] Directory not empty: '_internal' pip install wheel pip install -r requirements-3.7.txt diff --git a/tools/utils.sh b/tools/utils.sh index 53965b49..b79027f2 100644 --- a/tools/utils.sh +++ b/tools/utils.sh @@ -61,8 +61,7 @@ init_postgres_user() { # run as root # --- Ensure Unix user "scodoc" exists check_create_scodoc_user() { - id -u "${SCODOC_USER}" &> /dev/null - if [ "$?" != 0 ] + if ! id -u "${SCODOC_USER}" &> /dev/null then echo "Creating unix user ${SCODOC_USER}" adduser --no-create-home --shell /bin/bash --gecos "ScoDoc service" "${SCODOC_USER}" || die "failed to create user"