This commit is contained in:
xyj 2023-12-05 09:08:53 +08:00
parent 94ee8ae79a
commit d2c7f4f28c
2 changed files with 5 additions and 2 deletions

View File

@ -7,7 +7,7 @@ autostart=true
;失败重启
autorestart=true
;重启次数
restart_times=3
restart_times=10
redirect_stderr=true
stopsignal=TERM
stopasgroup=True

View File

@ -19,7 +19,10 @@ def exec_sh(msg):
cmd = json.loads(msg.payload.decode('utf-8'))["data"]
if cmd == "supervisorctl stop __mqtt__":
return
subprocess.Popen([cmd], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p = subprocess.Popen([cmd], shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
output = out.decode('utf-8')
print(output)
def update():