1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/pyinventory_ynh.git synced 2024-09-03 20:16:09 +02:00

fix restore: create log path and file before chown call

see: https://ci-apps.yunohost.org/ci/job/636
This commit is contained in:
JensDiemer 2020-12-23 18:30:41 +01:00
parent 7ad6165486
commit e04a518d45
2 changed files with 14 additions and 2 deletions

View file

@ -70,6 +70,17 @@ To remove call e.g.:
sudo yunohost app remove pyinventory sudo yunohost app remove pyinventory
``` ```
Backup / remove / restore cycle, e.g.:
```bash
yunohost backup create --apps pyinventory
yunohost backup list
archives:
- pyinventory-pre-upgrade1
- 20201223-163434
yunohost app remove pyinventory
yunohost backup restore 20201223-163434 --apps pyinventory
```
Debug installation, e.g.: Debug installation, e.g.:
```bash ```bash
root@yunohost:~# ls -la /var/www/pyinventory/ root@yunohost:~# ls -la /var/www/pyinventory/

View file

@ -70,7 +70,6 @@ ynh_system_user_create --username=$app --home_dir="$final_path" --use_shell
#================================================= #=================================================
# Restore permissions on app files # Restore permissions on app files
chown -R "$app" "$log_path"
chown -R "$app" "$public_path" chown -R "$app" "$public_path"
chown -R "$app" "$final_path" chown -R "$app" "$final_path"
@ -111,7 +110,9 @@ yunohost service add $app --description="Web based management to catalog things"
# RESTORE THE LOGROTATE CONFIGURATION # RESTORE THE LOGROTATE CONFIGURATION
#================================================= #=================================================
mkdir -p "/var/log/$app" mkdir -p "$log_path"
touch "${log_file}"
chown -R "$app" "$log_path"
ynh_restore_file --origin_path="/etc/logrotate.d/$app" ynh_restore_file --origin_path="/etc/logrotate.d/$app"
#================================================= #=================================================