From d89b9c06c5640e0ee6cfd14ce26ddee6d0953748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Thu, 14 Feb 2019 09:49:57 +0100 Subject: [PATCH] Fix shell for new user --- scripts/install | 7 ++++++- scripts/restore | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index 9fee527..b592d7b 100644 --- a/scripts/install +++ b/scripts/install @@ -60,7 +60,12 @@ config_nginx ynh_mysql_create_db "$dbname" "$dbuser" "$dbpass" # Add users -ynh_system_user_create $app +# We can't use the official helper (for now) because we need to set the shell for the login +test getent passwd "$app" &>/dev/null || \ + useradd -d "$DATADIR" --system --user-group "$app" --shell /bin/bash || \ + ynh_die "Unable to create $app system account" +# Should be replaced by this when getops is available in the helper ynh_system_user_create (probably in Yunohost 3.5) +# ynh_system_user_create --username= $app --home_dir=/opt/yunohost/$app --use_shell # create needed directories create_dir diff --git a/scripts/restore b/scripts/restore index c3c06f5..185f048 100644 --- a/scripts/restore +++ b/scripts/restore @@ -35,7 +35,12 @@ test ! -e "$final_path" || ynh_die "This path already contains a folder" #================================================= # Add users -ynh_system_user_create $app +# We can't use the official helper (for now) because we need to set the shell for the login +test getent passwd "$app" &>/dev/null || \ + useradd -d "$DATADIR" --system --user-group "$app" --shell /bin/bash || \ + ynh_die "Unable to create $app system account" +# Should be replaced by this when getops is available in the helper ynh_system_user_create (probably in Yunohost 3.5) +# ynh_system_user_create --username= $app --home_dir=/opt/yunohost/$app --use_shell # Restore all files ynh_restore