Skip to content

Set up as background service (daemon)

Nicolas Mehlei edited this page Sep 26, 2018 · 2 revisions
  1. create service file
sudo touch /etc/systemd/system/virtualdevicehost.service
  1. Fill file with the following content, change paths if necessary
[Unit]
Description=My service
After=network.target

[Service]
ExecStart=/home/pi/vdh-venv/bin/python3 -u /home/pi/VDHost/VDHApp.py MyFirstConfigurationStrategy -background
WorkingDirectory=/home/pi/VDHost
StandardOutput=inherit
StandardError=inherit
Restart=always
User=root

[Install]
WantedBy=multi-user.target
  1. reload services
sudo systemctl daemon-reload
  1. start service
sudo systemctl start virtualdevicehost.service
Clone this wiki locally