From a928d89c3e49d0c10ccab40590a441325615e1f1 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 9 Apr 2018 18:03:35 +0100 Subject: [PATCH] Try with lil-pids --- src/freedombone-app-datserver | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/freedombone-app-datserver b/src/freedombone-app-datserver index 8eb8c69c..61e430b4 100755 --- a/src/freedombone-app-datserver +++ b/src/freedombone-app-datserver @@ -211,7 +211,6 @@ function remove_datserver { remove_app datserver remove_completion_param install_datserver sed -i '/datserver/d' "$COMPLETION_FILE" - rm /usr/bin/run_datserver } function install_datserver { @@ -230,12 +229,13 @@ function install_datserver { exit 4635439 fi - { echo '#!/bin/bash'; - echo 'cd /etc/datserver'; - echo './node_modules/.bin/hypercored'; } > /usr/bin/run_datserver - chmod +x /usr/bin/run_datserver + if ! npm install lil-pids; then + echo $'lil-pids was not installed' + exit 36483463 + fi + + echo "$DATSERVER_DIRECTORY/node_modules/.bin/hypercored --cwd $DATSERVER_DIRECTORY" > $DATSERVER_DIRECTORY/services - set_completion_param "datserver version" "$DATSERVER_DAT_VERSION" set_completion_param "datserver hypercored version" "$DATSERVER_HYPERCORED_VERSION" adduser --system --home="$DATSERVER_DIRECTORY" --group datserver @@ -252,7 +252,7 @@ function install_datserver { echo '[Service]'; echo 'User=datserver'; echo 'Group=datserver'; - echo "ExecStart=/usr/bin/run_datserver"; + echo "ExecStart=$DATSERVER_DIRECTORY/node_modules/.bin/lil-pids $DATSERVER_DIRECTORY/services $DATSERVER_DIRECTORY/pids"; echo 'Restart=always'; echo "WorkingDirectory=$DATSERVER_DIRECTORY"; echo 'StandardError=syslog';