diff --git a/scripts/_common.sh b/scripts/_common.sh index 530e818..4572810 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -91,8 +91,8 @@ install_dependance() { } ynh_clean_setup () { - killall seafile-controller - killall seaf-server - killall ccnet-server - kill $(ps -C python2.7 -o pid,cmd | grep "python2.7 $final_path/seafile-server-$seafile_version/seahub/manage.py" | cut -d' ' -f1) + pkill -f seafile-controller + pkill -f seaf-server + pkill -f ccnet-server + pkill -f "seahub" } diff --git a/scripts/backup b/scripts/backup index b441733..2c5dc4b 100644 --- a/scripts/backup +++ b/scripts/backup @@ -36,12 +36,10 @@ db_pwd=$(ynh_app_setting_get ${app} mysqlpwd) ynh_backup $final_path ynh_backup /home/yunohost.app/seafile-data "data" 1 -ynh_backup /etc/nginx/conf.d/$domain.d/${APP}.conf +ynh_backup /etc/nginx/conf.d/$domain.d/${app}.conf ynh_backup /etc/init.d/seafile-server # Backup mysql -ynh_mysql_dump_db - ynh_mysql_dump_db ccnetdb > ${YNH_CWD}/ccnetdb.dmp ynh_mysql_dump_db seafiledb > ${YNH_CWD}/seafiledb.dmp ynh_mysql_dump_db seahubdb > ${YNH_CWD}/seahubdb.dmp \ No newline at end of file diff --git a/scripts/install b/scripts/install index 66e95c6..e39dfc1 100644 --- a/scripts/install +++ b/scripts/install @@ -108,6 +108,9 @@ echo 'HOST = ldap://localhost:389' | tee -a $final_path/conf/ccnet.conf echo 'BASE = ou=users,dc=yunohost,dc=org' | tee -a $final_path/conf/ccnet.conf echo 'LOGIN_ATTR = mail' | tee -a $final_path/conf/ccnet.conf +# Enable manually wiki +echo 'ENABLE_WIKI = True' | tee -a $final_path/conf/seahub_settings.py + # Fix local warning ynh_replace_string en_US.UTF-8 $LANG $final_path/seafile-server-$seafile_version/seahub.sh @@ -120,6 +123,7 @@ cp ../conf/seafile-server /etc/init.d ynh_replace_string SEAHUB_PORT $seahub_port /etc/init.d/seafile-server ynh_replace_string SEAFILE_DIR $final_path /etc/init.d/seafile-server chmod +x /etc/init.d/seafile-server +systemctl daemon-reload update-rc.d seafile-server defaults # Config nginx @@ -162,4 +166,10 @@ yunohost service add seafile-server # Restart seafile su - $seafile_user -s /bin/bash -c "$final_path/seafile-server-latest/seahub.sh stop" systemctl stop seafile-server.service -systemctl start seafile-server.service # || (sleep 2 && systemctl start seafile-server.service) +sleep 2 + +# We kill all process lunched by the script +pkill -f seafile-controller || true +pkill -f seaf-server || true + +systemctl start seafile-server.service diff --git a/scripts/restore b/scripts/restore index ec6d282..d9820a5 100644 --- a/scripts/restore +++ b/scripts/restore @@ -69,5 +69,7 @@ yunohost service add seafile-server # Reload nginx systemctl reload nginx.service -# start seafile +# Enable service and start seafile +systemctl daemon-reload +update-rc.d seafile-server defaults systemctl start seafile-server.service diff --git a/scripts/upgrade b/scripts/upgrade index 62bacc5..05a9a71 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -69,6 +69,9 @@ case $installed_version in # Update seafile by script ../conf/upgrade_6.1.exp $final_path/seafile-server-$seafile_version $root_pwd + + # Enable manually wiki + echo 'ENABLE_WIKI = True' | tee -a $final_path/conf/seahub_settings.py ;& esac