Add more log to debug

This commit is contained in:
Josué Tille 2018-06-07 21:20:50 +02:00
parent 55c42390a0
commit 122f6d8db0
6 changed files with 32 additions and 18 deletions

View file

@ -67,3 +67,20 @@ ynh_clean_setup () {
pkill -f ccnet-server
pkill -f "seahub"
}
# Reload (or other actions) a service and print a log in case of failure.
#
# usage: system_reload service_name [action]
# | arg: service_name - Name of the service to reload
# | arg: action - Action to perform with systemctl. Default: reload
system_reload () {
local service_name=$1
local action=${2:-reload}
# Reload, restart or start and print the log if the service fail to start or reload
systemctl $action $service_name || (
journalctl --lines=20 -u $service_name >&2
tail -n 50 $final_path/logs/*.log
false
)
}

View file

@ -61,6 +61,11 @@ ynh_add_nginx_config 'seahub_port fileserver_port webdav_port'
# Stop service before any change
sudo systemctl stop seafile-server.service
sleep 2
pkill -f seafile-controller || true
pkill -f seaf-server || true
pkill -f ccnet-server || true
pkill -f seahub || true
# Update Seafile Config
ynh_replace_string "SERVICE_URL = https://$old_domain$old_path" "SERVICE_URL = https://$domain$path_url" $final_path/conf/ccnet.conf
@ -136,8 +141,8 @@ mysql_relpace_db seahubdb two_factor_totpdevice user
mysql_relpace_db seahubdb wiki_personalwiki username
# Avoid the current effect
sleep 5
sleep 2
# Reload services
sudo systemctl reload nginx.service
ynh_system_reload seafile-server start
system_reload seafile-server start

View file

@ -127,16 +127,3 @@ ynh_delete_file_checksum () {
local checksum_setting_name=checksum_${1//[\/ ]/_} # Replace all '/' and ' ' by '_'
ynh_app_setting_delete $app $checksum_setting_name
}
# Reload (or other actions) a service and print a log in case of failure.
#
# usage: ynh_system_reload service_name [action]
# | arg: service_name - Name of the service to reload
# | arg: action - Action to perform with systemctl. Default: reload
ynh_system_reload () {
local service_name=$1
local action=${2:-reload}
# Reload, restart or start and print the log if the service fail to start or reload
systemctl $action $service_name || ( journalctl --lines=20 -u $service_name >&2 && false)
}

View file

@ -191,4 +191,4 @@ sleep 2
pkill -f seafile-controller || true
pkill -f seaf-server || true
ynh_system_reload seafile-server start
system_reload seafile-server start

View file

@ -72,4 +72,4 @@ systemctl reload nginx.service
# Enable service and start seafile
systemctl daemon-reload
update-rc.d seafile-server defaults
ynh_system_reload seafile-server start
system_reload seafile-server start

View file

@ -31,6 +31,11 @@ get_configuration
# stop seafile server
systemctl stop seafile-server.service
sleep 2
pkill -f seafile-controller || true
pkill -f seaf-server || true
pkill -f ccnet-server || true
pkill -f seahub || true
#=================================================
# MIGRATION FROM OLD VERSION
@ -163,7 +168,7 @@ ynh_secure_remove /tmp/seahub_cache
# restart seafile server
sleep 5
ynh_system_reload seafile-server start
system_reload seafile-server start
# remove old version files
ls $final_path | grep "seafile-server-" | egrep -v "(${seafile_version//./\\.})|(latest)" | \