I followed some tutorials to create a .service file:
[Unit]
Description=camera
After=graphical.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=/usr/bin/python3 /home/USER/projects/camera.py
[Install]
WantedBy=graphical.target
My camera.py uses gstreamer and opencv to run a camera feed. I want this to run on startup. I’ve run:
sudo systemctl daemon-reload
sudo systemctl enable camera.service
sudo systemctl start camera.service
at this point when I run systemctl status halo.service
it says that the script is active but nothing happens. Then when I run sudo reboot
and restart my Jetson, the halo.service is inactive (dead). How can I get this working on startup?
This is the tutorial I followed: Creating a Linux service with systemd | by Benjamin Morel | Medium