Skip to content

Commit a923dab

Browse files
committed
Add service file and instructions
1 parent 32603f4 commit a923dab

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,25 @@ If you get an error message
3838

3939
you are probably already running a stream. If you are on OctoPi with
4040
you can stop the preinstalled mjpg-streamer.
41-
41+
4242
sudo systemctl stop webcamd
4343

44+
### Run at startup (as service)
45+
46+
Remove the octopi included mjpg webcamd.service
47+
48+
- `sudo systemctl stop webcamd`
49+
- `sudo systemctl disable webcamd`
50+
- Backup: `sudo mv /etc/systemd/system/webcamd.service /home/pi/mjpg-streamer/`
51+
52+
Install new service (this asumes you cloned to ~/OctoStreamer, adjust paths
53+
and webcamd.service otherwise)
54+
55+
- `sudo ln -s -T /home/pi/OctoStreamer/webcamd.service /etc/systemd/system/webcamd.service`
56+
- `sudo systemctl daemon-reload`
57+
- `sudo systemctl enable webcamd`
58+
- `sudo systemctl start webcamd.service`
59+
4460
### Test
4561

4662
- Go to http://localhost:<port> in your browser. In Config, it should show your

webcamd.service

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[Unit]
2+
Description=the OctoStreamer webcam daemon
3+
After=multi-user.target
4+
5+
[Service]
6+
WorkingDirectory=/home/pi/OctoStreamer
7+
User=pi
8+
Environment="CAMERA=v4l2"
9+
ExecStart=/usr/bin/python3 /home/pi/OctoStreamer/app.py
10+
Restart=always
11+
Type=simple
12+
RestartSec=1
13+
14+
[Install]
15+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)