Fix shell for new user

This commit is contained in:
Josué Tille 2019-02-14 09:49:57 +01:00
parent 1c213a9ad8
commit d89b9c06c5
No known key found for this signature in database
GPG Key ID: D5E068C6DFA8681D
2 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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