From 440240ea7522afc25840ee662d0c0ff6b7382911 Mon Sep 17 00:00:00 2001 From: Neko Nekowazarashi Date: Tue, 30 May 2023 10:09:18 +0700 Subject: [PATCH] perubahan systemd --- scripts/install | 17 +++++------------ scripts/upgrade | 16 +++++----------- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/scripts/install b/scripts/install index 4b3f188..8057e68 100755 --- a/scripts/install +++ b/scripts/install @@ -9,13 +9,6 @@ source _common.sh source /usr/share/yunohost/helpers -#================================================= -# STARTING NODEJS -#================================================= - -ynh_install_nodejs --nodejs_version=$nodejs_version -ynh_use_nodejs - #================================================= # APP "BUILD" (DEPLOYING SOURCES, VENV, COMPILING ETC) #================================================= @@ -39,11 +32,6 @@ ynh_script_progression --message="Adding system configurations related to $app.. # Create a dedicated NGINX config using the conf/nginx.conf template ynh_add_nginx_config -# Create a dedicated systemd config -ynh_add_systemd_config - -yunohost service add $app --description="alternative to google translate" --log="/var/log/$app/$app.log" - #================================================= # APP INITIAL CONFIGURATION #================================================= @@ -73,6 +61,7 @@ echo "module.exports = { basePath: '$next_path', };" >> "$install_dir/next.confi #================================================= ynh_script_progression --message="Building the app..." --weight=1 +ynh_install_nodejs --nodejs_version=$nodejs_version ynh_use_nodejs ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm install --prefix="$install_dir" npx next telemetry disable @@ -85,6 +74,10 @@ ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm run build --pre #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 +ynh_add_systemd_config + +yunohost service add $app --description="alternative to google translate" --log="/var/log/$app/$app.log" + # Start a systemd service ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" diff --git a/scripts/upgrade b/scripts/upgrade index 6b06279..e22fd7d 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -81,12 +81,6 @@ fi # ownership to all files such as after the ynh_setup_source step chown -R $app:www-data "$install_dir" -#================================================= -# STARTING NODEJS -#================================================= - -ynh_use_nodejs - #================================================= # REAPPLY SYSTEM CONFIGURATIONS #================================================= @@ -95,11 +89,6 @@ ynh_script_progression --message="Upgrading system configurations related to $ap # Create a dedicated NGINX config using the conf/nginx.conf template ynh_add_nginx_config -# Create a dedicated systemd config -ynh_add_systemd_config - -yunohost service add $app --description="alternative to google translate" --log="/var/log/$app/$app.log" - #================================================= # RECONFIGURE THE APP (UPDATE CONF, APPLY MIGRATIONS...) #================================================= @@ -131,6 +120,11 @@ ynh_exec_warn_less ynh_exec_as $app $ynh_node_load_PATH $ynh_npm run build --pre #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 +# Create a dedicated systemd config +ynh_add_systemd_config + +yunohost service add $app --description="alternative to google translate" --log="/var/log/$app/$app.log" + ynh_systemd_action --service_name=$app --action="start" --log_path="/var/log/$app/$app.log" #=================================================