Hello.
I have a Python code where I start a video capture using gstreamer. If I start my script like python3 video.py
, it works ok.
Now I try to activate my script on system boot. I try to use systemctl but I faced some problems.
- Sometimes I have to run
sudo service nvargus-daemon restart
, because otherwise my code crashes. - Sometimes my code just stop doing anything, however the service is active.
I created a service with these parameters:
[Unit]
Description=Dummy Service
After=multi-user.target
Conflicts=getty@tty1.service
[Service]
Type=simple
RestartSec=20
WatchdogSec=600
Restart=on-failure
User=user1
ExecStart=/usr/bin/python3 /home/user1/doorbell_bot/video2.py
StandardInput=tty-force
[Install]
WantedBy=multi-user.target
What should I do to make my code works properly and without mistakes? The problem is that I cannot just activate it via python3 video.py
because it is a remote server and after logging out from ssh it will stop.
Thank you!