OpenMarine

Full Version: Running pypilot service
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I somehow managed to get pypilot installed and running on OpenPlotter 4. But I'm having trouble getting the service to start automatically. It refuses to run within its virtual environment and fails due to missing dependencies.

Here's the systemd unit file:

Code:
[Unit]
Description=pypilot
After=network-online.target local-fs.target
Wants=network-online.target

[Service]
Type=simple
WorkingDirectory=/home/pi/pypilot
ExecStart=/home/pi/pypilot/.venv/bin/python /home/pi/pypilot/pypilot --no-daemon
Environment=VIRTUAL_ENV=/home/pi/pypilot/.venv
Environment=PATH=/home/pi/pypilot/.venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
User=pi
Group=pi
Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal
KillMode=control-group

[Install]
WantedBy=multi-user.target

This service starts and runs fine when launched manually, e.g. systemctl start pypilot. But systemd does something different.