diff --git a/scripts/install b/scripts/install index 35c6880..761b392 100755 --- a/scripts/install +++ b/scripts/install @@ -58,19 +58,27 @@ chmod 750 "$install_dir/$APP_BIN" chown -R $app:www-data "$install_dir" #================================================= -# SYSTEM CONFIGURATION +# SETUP SYSTEMD #================================================= -ynh_script_progression --message="Adding system configurations related to $app..." --weight=1 +ynh_script_progression --message="Configuring a systemd service..." --weight=1 +# Create a dedicated systemd config ynh_add_systemd_config -yunohost service add $app --description="Matrix Discord pupetting bridge for YunoHost" --log="/var/log/$app/$app.log" +#================================================= +# SETUP LOGROTATE +#================================================= +ynh_script_progression --message="Configuring log rotation..." --weight=1 # Use logrotate to manage application logfile(s) -ynh_use_logrotate --logfile "/var/log/$app/$app.log" --nonappend --specific_user $app/$app -chmod -R 600 "/var/log/$app" -chmod 700 "/var/log/$app" -chown -R $app:$app /var/log/$app +ynh_use_logrotate + +#================================================= +# INTEGRATE SERVICE IN YUNOHOST +#================================================= +ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 + +yunohost service add $app --description="A interplanetary blogging platform" --log="/var/log/$app/$app.log" #================================================= # APP INITIAL CONFIGURATION @@ -105,18 +113,13 @@ ynh_store_file_checksum --file="$install_dir/config.yaml" #================================================= 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" - -# Wait until the synapse user is created -sleep 30 - # (Note that, by default, non-admins might not have your homeserver's permission to create Spaces.) if [ "$bot_synapse_adm" = true ] then ynh_psql_execute_as_root --database=$synapse_db_name --sql="UPDATE users SET admin = 1 WHERE name = ""$botname"";" fi -ynh_systemd_action --service_name=$app --action="restart" +ynh_systemd_action --service_name=$app --action="start" --log_path=systemd #================================================= # END OF SCRIPT