Try with lil-pids

This commit is contained in:
Bob Mottram 2018-04-09 18:03:35 +01:00
parent e103ca5333
commit a928d89c3e
1 changed files with 7 additions and 7 deletions

View File

@ -211,7 +211,6 @@ function remove_datserver {
remove_app datserver remove_app datserver
remove_completion_param install_datserver remove_completion_param install_datserver
sed -i '/datserver/d' "$COMPLETION_FILE" sed -i '/datserver/d' "$COMPLETION_FILE"
rm /usr/bin/run_datserver
} }
function install_datserver { function install_datserver {
@ -230,12 +229,13 @@ function install_datserver {
exit 4635439 exit 4635439
fi fi
{ echo '#!/bin/bash'; if ! npm install lil-pids; then
echo 'cd /etc/datserver'; echo $'lil-pids was not installed'
echo './node_modules/.bin/hypercored'; } > /usr/bin/run_datserver exit 36483463
chmod +x /usr/bin/run_datserver 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" set_completion_param "datserver hypercored version" "$DATSERVER_HYPERCORED_VERSION"
adduser --system --home="$DATSERVER_DIRECTORY" --group datserver adduser --system --home="$DATSERVER_DIRECTORY" --group datserver
@ -252,7 +252,7 @@ function install_datserver {
echo '[Service]'; echo '[Service]';
echo 'User=datserver'; echo 'User=datserver';
echo 'Group=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 'Restart=always';
echo "WorkingDirectory=$DATSERVER_DIRECTORY"; echo "WorkingDirectory=$DATSERVER_DIRECTORY";
echo 'StandardError=syslog'; echo 'StandardError=syslog';