diff --git a/mjpeg-relay.sh b/mjpeg-relay.sh new file mode 100755 index 0000000..32af777 --- /dev/null +++ b/mjpeg-relay.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +cd $SCRIPT_DIR/mjpeg-relay +python2 relay.py http://localhost:8989/stream diff --git a/systemd/mjpeg-relay.service b/systemd/mjpeg-relay.service index 2317e05..8627161 100644 --- a/systemd/mjpeg-relay.service +++ b/systemd/mjpeg-relay.service @@ -7,9 +7,11 @@ After=network.target User=g1smo RemainAfterExit=yes WorkingDirectory=/home/g1smo/galerija-bot/mjpeg-relay -ExecStart=python2 relay.py http://localhost:8989/stream +ExecStart=/usr/bin/screen -DmS mjpeg-relay /home/g1smo/galerija-bot/mjpeg-relay.sh RestartSec=5 -Restart=always +#Restart=always +Restart=on-failure +Type=forking [Install] WantedBy=multi-user.target