systemd service
All checks were successful
Deploy powerbar.ti Frontend Portal / Deploy-Tinance2-Frontend-Portal-Production (push) Successful in 36s
All checks were successful
Deploy powerbar.ti Frontend Portal / Deploy-Tinance2-Frontend-Portal-Production (push) Successful in 36s
This commit is contained in:
parent
2799621420
commit
d6194534f5
2 changed files with 19 additions and 14 deletions
19
powerbar.service
Normal file
19
powerbar.service
Normal file
|
@ -0,0 +1,19 @@
|
|||
[Unit]
|
||||
Description=Powerbar daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=powerbar
|
||||
Group=powerbar
|
||||
Environment="VIRTUAL_ENV=/opt/powerbar/venv"
|
||||
Environment="PATH=/opt/powerbar/venv/bin:/usr/local/bin:/usr/bin:/bin"
|
||||
ExecStart=/opt/powerbar/venv/bin/gunicorn app:app \
|
||||
-k geventwebsocket.gunicorn.workers.GeventWebSocketWorker \
|
||||
--name powerbar --workers 1 \
|
||||
--max-requests 400 --max-requests-jitter 50 \
|
||||
--log-level=info --bind=0.0.0.0:5000
|
||||
WorkingDirectory=/opt/powerbar/ti-powerbar
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
14
telnet.py
14
telnet.py
|
@ -1,14 +0,0 @@
|
|||
import telnetlib
|
||||
|
||||
def check_input_error():
|
||||
tn = telnetlib.Telnet("10.209.10.111", 2168)
|
||||
tn.write("/\r\n".encode('ascii'))
|
||||
for _ in range(3):
|
||||
output = tn.read_until(b"Input error", timeout=3).decode('ascii')
|
||||
print(output)
|
||||
if "Input error" in output:
|
||||
return True
|
||||
return False
|
||||
|
||||
result = check_input_error()
|
||||
print(result)
|
Loading…
Reference in a new issue