From 9e80a1787088fa6e7cdb1ca5a6542510c3eb0192 Mon Sep 17 00:00:00 2001 From: lapineige Date: Tue, 15 Aug 2023 12:03:28 +0200 Subject: [PATCH] =?UTF-8?q?Here=20we=20go=20for=20a=20proper=20daemon=20se?= =?UTF-8?q?rvice=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/install | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/install b/scripts/install index daf33de..18f5760 100644 --- a/scripts/install +++ b/scripts/install @@ -76,7 +76,7 @@ ynh_exec_warn ynh_exec_as $app $ynh_node_load_PATH -s $SHELL -lc "WITH_DOCKER=no #ynh_exec_warn just rel-build # node needs (root) access to /usr/local/lib/node_modules #================================================= -# Run the release +# START SYSTEMD SERVICE - Run the release #================================================= release_folder="_build/prod/rel/bonfire" @@ -85,12 +85,19 @@ release_folder="_build/prod/rel/bonfire" ## Database created before, let's run the migrations #ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire eval 'EctoSparkles.Migrator.migrate()'" -ynh_script_progression --message="Starting Bonfire..." --weight=1 -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire start" +#ynh_script_progression --message="Starting Bonfire..." --weight=1 +#ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire start" -# start bonfire as a daemon -ynh_script_progression --message="Starting Bonfire daemon..." --weight=1 -ynh_exec_warn ynh_exec_as $app -s $SHELL -lc "WITH_DOCKER=no just cmd $release_folder/bin/bonfire start daemon" +# Create a dedicated systemd config +ynh_add_systemd_config + +yunohost service add $app --description="Bonfire daemon" --log="/var/log/$app/$app.log" + + +ynh_script_progression --message="Starting Bonfire daemon service..." --weight=1 + +# Start a systemd service +ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" #================================================= # END OF SCRIPT