Commit 46dcba6b authored by Bc. Petr Elexa's avatar Bc. Petr Elexa

server: update scripts

parent 8715e905
......@@ -6,7 +6,9 @@ After=multi-user.target redis_6379.service
[Service]
User=acs-srvc
ExecStart=/usr/local/bin/acs-server -l /var/log/acs-server can0 1 localhost 6379
TimeoutSec=30s
TimeoutSec=20
RestartSec=90
Restart=on-failure
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -4,7 +4,7 @@
# Build parameters
APP_BIN=acs-server
WORK_DIR=dist
WORK_DIR=tmp
INPUT_DIR=src
INSTALL_DIR=/usr/local/bin
......@@ -12,6 +12,9 @@ rm -rf $WORK_DIR
mkdir $WORK_DIR
cp -r $INPUT_DIR/* $WORK_DIR
rm -rf bin
mkdir bin
# echo "Collecting requirements"
# python3 -m pip install -r requirements.txt --upgrade --target $WORK_DIR
......@@ -21,7 +24,7 @@ cp -r $INPUT_DIR/* $WORK_DIR
# fi
echo "Packing sources..."
python3 -m zipapp -p "/usr/bin/env python3" -m "acs_server:main" -o $APP_BIN $WORK_DIR
python3 -m zipapp -p "/usr/bin/env python3" -m "acs_server:main" -o bin/$APP_BIN $WORK_DIR
if [ $? -ne 0 ] ; then
echo "Error occured"
exit 1
......@@ -29,7 +32,7 @@ fi
echo "Done"
sudo cp $APP_BIN $INSTALL_DIR/$APP_BIN
sudo cp bin/$APP_BIN $INSTALL_DIR/$APP_BIN
if [ $? -eq 0 ] ; then
echo "Installed to $INSTALL_DIR/$APP_BIN"
fi
......
......@@ -12,4 +12,4 @@ SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
# Start the server
python3 $SCRIPTPATH/src/acs_server.py -v $CAN_IF $CAN_ADDR $REDIS_HOST $REDIS_PORT
\ No newline at end of file
python3 $SCRIPTPATH/src/acs_server.py $CAN_IF $CAN_ADDR $REDIS_HOST $REDIS_PORT
#!/bin/sh
# Default parameters to server
CAN_IF=can0
CAN_ADDR=1
REDIS_HOST=localhost
REDIS_PORT=6379
# Absolute path to this script, e.g. /home/user/bin/foo.sh
SCRIPT=$(readlink -f "$0")
# Absolute path this script is in, thus /home/user/bin
SCRIPTPATH=$(dirname "$SCRIPT")
# Start the server
python3 $SCRIPTPATH/src/acs_server.py -v $CAN_IF $CAN_ADDR $REDIS_HOST $REDIS_PORT
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment