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:
parent
4dc9125793
commit
c9ac51900e
5 changed files with 42 additions and 37 deletions
|
@ -31,9 +31,7 @@ domain=$(ynh_app_setting_get $app domain)
|
||||||
db_name=$(ynh_app_setting_get "$app" psql_db)
|
db_name=$(ynh_app_setting_get "$app" psql_db)
|
||||||
|
|
||||||
# Stop Plume for backup
|
# Stop Plume for backup
|
||||||
systemctl stop "$app"
|
yunohost service stop "$app"
|
||||||
# App needs time to stop
|
|
||||||
sleep 10
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD BACKUP STEPS
|
# STANDARD BACKUP STEPS
|
||||||
|
@ -83,12 +81,7 @@ ynh_backup "/etc/systemd/system/$app.service"
|
||||||
#ynh_backup "/etc/cron.d/$app"
|
#ynh_backup "/etc/cron.d/$app"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX
|
# START SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
systemctl reload nginx
|
yunohost service start $app
|
||||||
systemctl enable "$app"
|
|
||||||
systemctl start "$app"
|
|
||||||
# App needs time to start
|
|
||||||
sleep 10
|
|
||||||
|
|
||||||
|
|
|
@ -241,9 +241,6 @@ fi
|
||||||
|
|
||||||
# Create a dedicated systemd config
|
# Create a dedicated systemd config
|
||||||
ynh_add_systemd_config
|
ynh_add_systemd_config
|
||||||
systemctl enable "$app"
|
|
||||||
systemctl start "$app"
|
|
||||||
sleep 30
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SETUP APPLICATION WITH CURL
|
# SETUP APPLICATION WITH CURL
|
||||||
|
@ -336,7 +333,7 @@ ynh_use_logrotate
|
||||||
|
|
||||||
#yunohost service add $app --log "/var/log/$app/APP.log"
|
#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
|
# 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
|
# SETUP SSOWAT
|
||||||
|
@ -355,6 +352,12 @@ fi
|
||||||
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
# START SERVICE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
yunohost service start $app
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# SEND A README FOR THE ADMIN
|
# SEND A README FOR THE ADMIN
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
|
@ -23,13 +23,6 @@ final_path=$(ynh_app_setting_get $app final_path)
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD REMOVE
|
# STANDARD REMOVE
|
||||||
#=================================================
|
|
||||||
# STOP AND REMOVE SERVICE
|
|
||||||
#=================================================
|
|
||||||
|
|
||||||
# Remove the dedicated systemd config
|
|
||||||
ynh_remove_systemd_config
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# REMOVE SERVICE FROM ADMIN PANEL
|
# REMOVE SERVICE FROM ADMIN PANEL
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -42,6 +35,14 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
|
# STOP AND REMOVE SERVICE
|
||||||
|
#=================================================
|
||||||
|
|
||||||
|
# Remove the dedicated systemd config
|
||||||
|
ynh_remove_systemd_config
|
||||||
|
|
||||||
|
#=================================================
|
||||||
|
|
||||||
# REMOVE DEPENDENCIES
|
# REMOVE DEPENDENCIES
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,7 @@ ynh_psql_execute_file_as_root ./db.sql "$db_name"
|
||||||
|
|
||||||
# Create the dedicated user (if not existing)
|
# Create the dedicated user (if not existing)
|
||||||
ynh_system_user_create $app "$final_path"
|
ynh_system_user_create $app "$final_path"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE USER RIGHTS
|
# RESTORE USER RIGHTS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -94,11 +95,6 @@ chown -R $app: $final_path
|
||||||
# Define and install dependencies
|
# 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
|
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
|
# RESTORE SYSTEMD
|
||||||
|
@ -111,6 +107,12 @@ systemctl enable $app.service
|
||||||
|
|
||||||
( cd $final_path/$app && sudo -u "$app" $final_path/.cargo/bin/plm search unlock )
|
( 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
|
# RESTORE THE CRON FILE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -126,12 +128,16 @@ ynh_restore_file "/etc/logrotate.d/$app"
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
#=================================================
|
#=================================================
|
||||||
# RELOAD NGINX AND START PLEROMA
|
# RELOAD NGINX AND PHP-FPM
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
|
#systemctl reload php5-fpm
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
systemctl enable "$app"
|
|
||||||
systemctl start "$app"
|
#=================================================
|
||||||
# App needs time to start
|
# START SERVICE
|
||||||
sleep 10
|
#=================================================
|
||||||
|
|
||||||
|
yunohost service start $app
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
source _common.sh
|
source _common.sh
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# LOAD SETTINGS
|
# LOAD SETTINGS
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -67,7 +66,7 @@ ynh_clean_setup () {
|
||||||
ynh_abort_if_errors
|
ynh_abort_if_errors
|
||||||
|
|
||||||
# Stop Plume for upgrade
|
# Stop Plume for upgrade
|
||||||
systemctl stop "$app"
|
yunohost service stop "$app"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -178,7 +177,10 @@ fi
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
systemctl enable "$app"
|
|
||||||
systemctl restart "$app"
|
#=================================================
|
||||||
# App needs time to start
|
# START SERVICE
|
||||||
sleep 10
|
#=================================================
|
||||||
|
|
||||||
|
yunohost service start $app
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue