1
0
Fork 0

이상한 오류 수정

This commit is contained in:
Sangbum Kim 2017-11-21 00:23:14 +09:00
parent 5529816d3c
commit 993abb0363
3 changed files with 5 additions and 2 deletions

2
air_monitor Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
exec python main.py

View File

@ -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

View File

@ -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')