Adding python3 virtualenv to python systemd services
This commit is contained in:
@@ -9,6 +9,8 @@ config_file=$my_dir/birdnet.conf
|
|||||||
export USER=$USER
|
export USER=$USER
|
||||||
export HOME=$HOME
|
export HOME=$HOME
|
||||||
|
|
||||||
|
export PYTHON_VIRTUAL_ENV="$HOME/BirdNET-Pi/birdnet/bin/python3"
|
||||||
|
|
||||||
install_depends() {
|
install_depends() {
|
||||||
apt install -y debian-keyring debian-archive-keyring apt-transport-https
|
apt install -y debian-keyring debian-archive-keyring apt-transport-https
|
||||||
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo tee /etc/apt/trusted.gpg.d/caddy-stable.asc
|
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo tee /etc/apt/trusted.gpg.d/caddy-stable.asc
|
||||||
@@ -66,7 +68,7 @@ Restart=always
|
|||||||
Type=simple
|
Type=simple
|
||||||
RestartSec=10
|
RestartSec=10
|
||||||
User=${USER}
|
User=${USER}
|
||||||
ExecStart=/usr/local/bin/server.py
|
ExecStart=$PYTHON_VIRTUAL_ENV /usr/local/bin/server.py
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
@@ -325,7 +327,7 @@ Restart=always
|
|||||||
RestartSec=120
|
RestartSec=120
|
||||||
Type=simple
|
Type=simple
|
||||||
User=$USER
|
User=$USER
|
||||||
ExecStart=/usr/local/bin/daily_plot.py
|
ExecStart=$PYTHON_VIRTUAL_ENV /usr/local/bin/daily_plot.py
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Reference in New Issue
Block a user