I have a simple application which streams video with a webcam called "streamer". I'd like to start "streamer" when my Linux device boots with systemd.
Next, I have the following systemd, service file, /lib/systemd/system/streamer.service
[Unit]
Description=Webcam Service
[Service]
ExecStart=/usr/bin/streamer
[Install]
WantedBy=multi-user.target
When I run this manually, it works such as:
systemctl start streamer
However, when I enable the script and reboot, it does not start automatically:
systemctl enable streamer
reboot
How can I get this to work with my webcam?
Best Answer
I had to add a udev rule to detect camera,
/etc/udev/rules.d/webcam.rules
:Then I made the following changes to my service file,
/lib/systemd/system/streamer.service
:The reason for this is in the manpage for
systemd.unit
:https://www.freedesktop.org/software/systemd/man/systemd.unit.html#BindsTo=