From 49808fef24761b7ae6bce8808da467310f3ab3ac Mon Sep 17 00:00:00 2001 From: root Date: Thu, 21 Nov 2019 11:03:39 +0000 Subject: [PATCH] Fix wrong nodejs path --- conf/systemd.service | 2 +- scripts/install | 2 ++ scripts/restore | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/conf/systemd.service b/conf/systemd.service index 5f61256..7a2fe94 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -8,7 +8,7 @@ WorkingDirectory=__FINALPATH__ User=__APP__ Group=__APP__ Environment="NODE_ENV=production" -ExecStart=/usr/bin/node index.js run +ExecStart=__NODEJS_PATH__/node index.js run Restart=always [Install] diff --git a/scripts/install b/scripts/install index f27be8f..5f3788b 100644 --- a/scripts/install +++ b/scripts/install @@ -74,6 +74,7 @@ ynh_app_setting_set $app port $port # install nodejs ynh_install_nodejs 8 +ynh_use_nodejs # add yarn repo for Debian curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - @@ -174,6 +175,7 @@ chown -R $app: $final_path #================================================= # Create a dedicated systemd config +ynh_replace_string --match_string="__NODEJS_PATH__" --replace_string="$nodejs_path" --target_file="../conf/systemd.service" ynh_add_systemd_config systemctl start "$app" diff --git a/scripts/restore b/scripts/restore index 9943548..c065658 100755 --- a/scripts/restore +++ b/scripts/restore @@ -82,6 +82,7 @@ chown -R $app: $final_path # install nodejs ynh_install_nodejs 8 +ynh_use_nodejs # add yarn repo for Debian curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -