이상한 오류 수정
This commit is contained in:
parent
5529816d3c
commit
993abb0363
|
@ -0,0 +1,2 @@
|
||||||
|
#!/bin/bash
|
||||||
|
exec python main.py
|
|
@ -4,7 +4,9 @@ After=syslog.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
WorkingDirectory=/opt/air_monitor
|
WorkingDirectory=/opt/air_monitor
|
||||||
ExecStart=/opt/air_monitor/venv/bin/python main.py
|
Environment=VIRTUAL_ENV=/opt/air_monitor/venv/
|
||||||
|
Environment=PATH=$VIRTUAL_ENV/bin:$PATH
|
||||||
|
ExecStart=/opt/air_monitor/air_monitor
|
||||||
TimeoutStartSec=5
|
TimeoutStartSec=5
|
||||||
User=nobody
|
User=nobody
|
||||||
Group=nobody
|
Group=nobody
|
||||||
|
|
1
main.py
1
main.py
|
@ -45,7 +45,6 @@ if __name__ == '__main__':
|
||||||
daemon.notify('READY=1')
|
daemon.notify('READY=1')
|
||||||
for at, info in getStat(dev):
|
for at, info in getStat(dev):
|
||||||
message = Message('air', int(at*1000000000), tags, info._asdict())
|
message = Message('air', int(at*1000000000), tags, info._asdict())
|
||||||
print(json.dumps([message._asdict()]))
|
|
||||||
metric.write_points([message._asdict()])
|
metric.write_points([message._asdict()])
|
||||||
finally:
|
finally:
|
||||||
daemon.notify('STOPPING=1')
|
daemon.notify('STOPPING=1')
|
||||||
|
|
Loading…
Reference in New Issue