From f33f85f0693a8ae41231c8159a81b5fd21204e16 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Wed, 7 Aug 2019 16:20:30 +0200 Subject: [PATCH 1/2] Also remove the env var file --- scripts/remove | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/remove b/scripts/remove index 2e18171..199ec28 100644 --- a/scripts/remove +++ b/scripts/remove @@ -28,6 +28,8 @@ final_path=$(ynh_app_setting_get $app final_path) ynh_remove_systemd_config +ynh_secure_remove /etc/systemd/system/ethercalc.env + #================================================= # REMOVE SERVICE FROM ADMIN PANEL #================================================= From c5fe37d30af97cdd71b4cbad0a97ebbb3ad3a5cf Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Wed, 7 Aug 2019 16:22:55 +0200 Subject: [PATCH 2/2] Use the correct node path --- conf/systemd.service | 2 +- scripts/_common.sh | 2 ++ scripts/install | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/conf/systemd.service b/conf/systemd.service index 7f3282c..3766f3f 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -6,7 +6,7 @@ After=network.target Type=simple User=__APP__ Group=__APP__ -ExecStart=/opt/node_n/bin/ethercalc --port __PORT__ --expire __EXPIRE__ +ExecStart=/opt/node_n/n/versions/node/__NODE_VERSION__/bin/ethercalc --port __PORT__ --expire __EXPIRE__ EnvironmentFile=/etc/systemd/system/ethercalc.env RuntimeMaxSec=86400 Restart=always diff --git a/scripts/_common.sh b/scripts/_common.sh index 69c30cc..7c0c3d4 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -6,6 +6,8 @@ pkg_dependencies="redis-server" +node_version="4.8.7" + # ============================================================================= # YUNOHOST 2.7 FORTHCOMING HELPERS # ============================================================================= diff --git a/scripts/install b/scripts/install index 3a8e1a5..ec99121 100644 --- a/scripts/install +++ b/scripts/install @@ -58,7 +58,9 @@ ynh_app_setting_set $app port $port # INSTALL NODEJS #================================================= -ynh_install_nodejs 4.8.7 +ynh_install_nodejs $node_version + +ynh_app_setting_set $app node_version $node_version #================================================= # INSTALL DEPENDENCIES @@ -100,6 +102,7 @@ ynh_add_systemd_config ynh_replace_string --match_string="__PORT__" --replace_string=$port --target_file=/etc/systemd/system/ethercalc.service ynh_replace_string --match_string="__EXPIRE__" --replace_string=$expire --target_file=/etc/systemd/system/ethercalc.service +ynh_replace_string --match_string="__NODE_VERSION__" --replace_string=$node_version --target_file=/etc/systemd/system/ethercalc.service cp ../conf/ethercalc.env /etc/systemd/system/ethercalc.env