mirror of
https://github.com/YunoHost-Apps/pgadmin_ynh.git
synced 2024-09-03 19:56:38 +02:00
Fix install issues
This commit is contained in:
parent
e661e994fa
commit
214e74a7b5
3 changed files with 14 additions and 4 deletions
|
@ -22,10 +22,16 @@ setup_dir() {
|
|||
install_source() {
|
||||
# Clean venv is it was on python with an old version in case major upgrade of debian
|
||||
if [ ! -e $final_path/lib/python$python_version ]; then
|
||||
ynh_secure_remove --file=$final_path
|
||||
ynh_secure_remove --file=$final_path/bin
|
||||
ynh_secure_remove --file=$final_path/lib
|
||||
ynh_secure_remove --file=$final_path/lib64
|
||||
ynh_secure_remove --file=$final_path/include
|
||||
ynh_secure_remove --file=$final_path/share
|
||||
ynh_secure_remove --file=$final_path/pyvenv.cfg
|
||||
fi
|
||||
|
||||
mkdir -p $final_path
|
||||
chown $pgadmin_user:root -R $final_path
|
||||
|
||||
if [ -n "$(uname -m | grep arm)" ]
|
||||
then
|
||||
|
@ -40,9 +46,9 @@ install_source() {
|
|||
# We need this to be able to install cryptgraphy
|
||||
export PATH="$PATH:$final_path/.cargo/bin:$final_path/.local/bin:/usr/local/sbin"
|
||||
if [ -e $final_path/.rustup ]; then
|
||||
sudo -u "$synapse_user" env PATH=$PATH rustup update
|
||||
sudo -u "$pgadmin_user" env PATH=$PATH rustup update
|
||||
else
|
||||
sudo -u "$synapse_user" bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=stable'
|
||||
sudo -u "$pgadmin_user" bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=stable'
|
||||
fi
|
||||
|
||||
# Install virtualenv if it don't exist
|
||||
|
|
|
@ -63,7 +63,7 @@ ynh_install_app_dependencies $dependances
|
|||
|
||||
# Create user
|
||||
ynh_script_progression --message="Configuring system user..."
|
||||
ynh_system_user_create --username $pgadmin_user --home_dir /var/lib/$app
|
||||
ynh_system_user_create --username $pgadmin_user --home_dir $final_path
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_script_progression --message="Installing sources files..." --weight=10
|
||||
|
|
|
@ -33,6 +33,10 @@ ynh_clean_setup () {
|
|||
test -e /etc/uwsgi/apps-available/$app.ini && \
|
||||
ynh_systemd_action --service_name "uwsgi-app@$app.service" --action stop
|
||||
|
||||
if ! grep -q "$final_path" /etc/passwd; then
|
||||
sed --in-place -r "s@$app\:x\:([[:digit:]]+\:[[:digit:]]+)\:\:/.*/$app\:/usr/sbin/nologin@$app\:x\:\1\:\:$final_path\:/usr/sbin/nologin@g" /etc/passwd
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# STANDARD UPGRADE STEPS
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue