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

Services cleanup

This commit is contained in:
Yalh 2019-01-24 03:22:55 +01:00 committed by yalh76
parent 76999849e5
commit 53aa4713b6
5 changed files with 42 additions and 37 deletions

View file

@ -31,9 +31,7 @@ domain=$(ynh_app_setting_get $app domain)
db_name=$(ynh_app_setting_get "$app" psql_db)
# Stop Plume for backup
systemctl stop "$app"
# App needs time to stop
sleep 10
yunohost service stop "$app"
#=================================================
# STANDARD BACKUP STEPS
@ -83,12 +81,7 @@ ynh_backup "/etc/systemd/system/$app.service"
#ynh_backup "/etc/cron.d/$app"
#=================================================
# RELOAD NGINX
# START SERVICE
#=================================================
systemctl reload nginx
systemctl enable "$app"
systemctl start "$app"
# App needs time to start
sleep 10
yunohost service start $app

View file

@ -241,9 +241,6 @@ fi
# Create a dedicated systemd config
ynh_add_systemd_config
systemctl enable "$app"
systemctl start "$app"
sleep 30
#=================================================
# SETUP APPLICATION WITH CURL
@ -336,7 +333,7 @@ ynh_use_logrotate
#yunohost service add $app --log "/var/log/$app/APP.log"
# if using yunohost version 3.2 or more in the 'manifest.json', a description can be added
#yunohost service add $app --description "$app daemon for XXX" --log "/var/log/$app/APP.log"
yunohost service add $app --description "$app daemon for XXX" --log "/var/log/$app/$app.log"
#=================================================
# SETUP SSOWAT
@ -355,6 +352,12 @@ fi
systemctl reload nginx
#=================================================
# START SERVICE
#=================================================
yunohost service start $app
#=================================================
# SEND A README FOR THE ADMIN
#=================================================

View file

@ -23,13 +23,6 @@ final_path=$(ynh_app_setting_get $app final_path)
#=================================================
# STANDARD REMOVE
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
# Remove the dedicated systemd config
ynh_remove_systemd_config
#=================================================
# REMOVE SERVICE FROM ADMIN PANEL
#=================================================
@ -42,6 +35,14 @@ then
fi
#=================================================
# STOP AND REMOVE SERVICE
#=================================================
# Remove the dedicated systemd config
ynh_remove_systemd_config
#=================================================
# REMOVE DEPENDENCIES
#=================================================

View file

@ -72,6 +72,7 @@ ynh_psql_execute_file_as_root ./db.sql "$db_name"
# Create the dedicated user (if not existing)
ynh_system_user_create $app "$final_path"
#=================================================
# RESTORE USER RIGHTS
#=================================================
@ -94,11 +95,6 @@ chown -R $app: $final_path
# Define and install dependencies
ynh_install_app_dependencies gettext postgresql postgresql-contrib libpq-dev git curl gcc make openssl libssl-dev pkg-config sqlite3 libsqlite3-dev
#=================================================
# ADVERTISE SERVICE IN ADMIN PANEL
#=================================================
#yunohost service add $app --log "/var/log/$app/APP.log"
#=================================================
# RESTORE SYSTEMD
@ -111,6 +107,12 @@ systemctl enable $app.service
( cd $final_path/$app && sudo -u "$app" $final_path/.cargo/bin/plm search unlock )
#=================================================
# ADVERTISE SERVICE IN ADMIN PANEL
#=================================================
yunohost service add $app --log "/var/log/$app/$app.log"
#=================================================
# RESTORE THE CRON FILE
#=================================================
@ -126,12 +128,16 @@ ynh_restore_file "/etc/logrotate.d/$app"
#=================================================
# GENERIC FINALIZATION
#=================================================
# RELOAD NGINX AND START PLEROMA
# RELOAD NGINX AND PHP-FPM
#=================================================
#systemctl reload php5-fpm
systemctl reload nginx
systemctl enable "$app"
systemctl start "$app"
# App needs time to start
sleep 10
#=================================================
# START SERVICE
#=================================================
yunohost service start $app

View file

@ -9,7 +9,6 @@
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# LOAD SETTINGS
#=================================================
@ -67,7 +66,7 @@ ynh_clean_setup () {
ynh_abort_if_errors
# Stop Plume for upgrade
systemctl stop "$app"
yunohost service stop "$app"
@ -178,7 +177,10 @@ fi
#=================================================
systemctl reload nginx
systemctl enable "$app"
systemctl restart "$app"
# App needs time to start
sleep 10
#=================================================
# START SERVICE
#=================================================
yunohost service start $app