diff --git a/scripts/restore b/scripts/restore index cc6f762..5bf19d7 100644 --- a/scripts/restore +++ b/scripts/restore @@ -88,6 +88,23 @@ db_pwd=$(ynh_app_setting_get --app=$app --key=db_pwd) ynh_mongo_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_mongo_restore_db --database="$db_name" < ./dump.bson +#================================================= +# MODIFY A CONFIG FILE +#================================================= +ynh_script_progression --message="Configuring a mongod..." --weight=1 + +sed -i "s/^# engine:/ engine: wiredTiger/" /etc/mongod.conf +sed -i "s/^#replication:/replication:\n replSetName: rs01/" /etc/mongod.conf + +ynh_exec_warn_less systemctl enable $mongodb_servicename --quiet +ynh_systemd_action --service_name=$mongodb_servicename --action=restart + +sleep 10 + +#mongo --eval "printjson(rs.initiate())" + +ynh_mongo_exec --command="printjson(rs.initiate())" --eval + #================================================= # RESTORE SYSTEMD #================================================= @@ -115,14 +132,14 @@ yunohost service add $app --description="Team collaboration communication platfo #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd #================================================= # GENERIC FINALIZATION #================================================= # RELOAD NGINX AND PHP-FPM #================================================= -ynh_script_progression --message="Reloading NGINX web server and PHP-FPM..." --weight=1 +ynh_script_progression --message="Reloading NGINX web server..." --weight=1 ynh_systemd_action --service_name=nginx --action=reload diff --git a/scripts/upgrade b/scripts/upgrade index fe265e6..3546a73 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -145,6 +145,7 @@ ynh_systemd_action --service_name=$mongodb_servicename --action=restart sleep 10 mongo --eval "printjson(rs.initiate())" + #================================================= # SETUP LOGROTATE #================================================= @@ -159,6 +160,7 @@ ynh_use_logrotate --non-append ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 yunohost service add $app --description="Team collaboration communication platform" --log="/var/log/$app/$app.log" +sleep 120 #================================================= # START SYSTEMD SERVICE @@ -166,7 +168,7 @@ yunohost service add $app --description="Team collaboration communication platfo ynh_script_progression --message="Starting a systemd service..." --weight=10 ynh_systemd_action --service_name=$mongodb_servicename --action=restart --log_path=systemd -ynh_systemd_action --service_name=$app --action=start --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name=$app --action=start --log_path=systemd #================================================= # RELOAD NGINX