From 0e1df25d936c508d2c9fd9743e908a3a4495a611 Mon Sep 17 00:00:00 2001 From: Selamanse Date: Fri, 19 Oct 2018 21:46:26 +0200 Subject: [PATCH] Add node bin absolute path recognition --- conf/rocketchat.service | 2 +- scripts/install | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/conf/rocketchat.service b/conf/rocketchat.service index c1783b0..7afc22b 100644 --- a/conf/rocketchat.service +++ b/conf/rocketchat.service @@ -6,7 +6,7 @@ After=network.target Type=simple WorkingDirectory=#DESTDIR# User=#USER# -ExecStart=node main.js +ExecStart=#NODE# main.js Restart=always SyslogIdentifier=rocketchat Environment="BIND_IP=127.0.0.1" diff --git a/scripts/install b/scripts/install index 420d5a7..c24bd10 100644 --- a/scripts/install +++ b/scripts/install @@ -84,6 +84,9 @@ sed -i "s@#PORT#@$port@g" ../conf/rocketchat.service sed -i "s@#USER#@$serviceuser@g" ../conf/rocketchat.service sed -i "s@#DESTDIR#@$final_path@g" ../conf/rocketchat.service sed -i "s@#DBNAME#@$dbname@g" ../conf/rocketchat.service +# absolute node path needed +NODE_BIN=$(which node) +sed -i "s@#NODE#@$NODE_BIN@g" ../conf/rocketchat.service sudo cp ../conf/rocketchat.service /etc/systemd/system/$app.service sudo systemctl daemon-reload