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