-
Notifications
You must be signed in to change notification settings - Fork 0
/
plant-heater-control.service
33 lines (28 loc) · 1.19 KB
/
plant-heater-control.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# # -*- systemd -*-
# - uses virtualenv python version
# cd /home/pi/projects/indoor-seedomation/etc
# sudo cp plant-heater-control.service /lib/systemd/system/plant-heater-control@.service
# sudo chmod 644 /lib/systemd/system/plant-heater-control@.service
# sudo systemctl daemon-reload
# sudo systemctl enable plant-heater-control@pi.service
# sudo systemctl status plant-heater-control@pi.service
# sudo systemctl start plant-heater-control@pi.service
# journalctl -u plant-heater-control@pi.service
[Unit]
Description=Control plant bed heater. Uses MQTT and WeMo
Documentation=https://github.com/idcrook/indoor-seedomation
After=network.target network-online.target
# After=network.target time-sync.target
ConditionPathExists=/home/pi/projects/indoor-seedomation/etc
[Service]
Type=simple
WorkingDirectory=/home/pi/projects/indoor-seedomation
ExecStart=/home/pi/projects/indoor-seedomation/.venv/bin/python \
/home/pi/projects/indoor-seedomation/loop.py
User=pi
# Use DNS lookup as proxy for network availability
ExecStartPre=/bin/bash -c 'until host www.google.com; do sleep 1; done'
# do not buffer output (useful for debugging)
Environment=PYTHONUNBUFFERED=1
[Install]
WantedBy=default.target