mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
adjusted daemon process starting
This commit is contained in:
parent
b81bcb2c9f
commit
a48c7f08f1
2 changed files with 8 additions and 25 deletions
|
@ -156,9 +156,9 @@ function stopAllTransmissions() {
|
||||||
<!-------------------------------- MAIN AREA ---------------->
|
<!-------------------------------- MAIN AREA ---------------->
|
||||||
|
|
||||||
<!------------------------------------------------------------------------------------------>
|
<!------------------------------------------------------------------------------------------>
|
||||||
<div class="container p-3">
|
<div class="container">
|
||||||
<div
|
<div
|
||||||
class="row collapse multi-collapse show mt-4"
|
class="row collapse multi-collapse show mt-3"
|
||||||
id="collapseFirstRow"
|
id="collapseFirstRow"
|
||||||
>
|
>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
|
@ -88,28 +88,15 @@ class DAEMON:
|
||||||
"""
|
"""
|
||||||
while True:
|
while True:
|
||||||
threading.Event().wait(0.01)
|
threading.Event().wait(0.01)
|
||||||
try:
|
|
||||||
print(Daemon.rigctldprocess)
|
|
||||||
result = Daemon.rigctldprocess
|
|
||||||
print(f'Standard Output: {result.stdout}')
|
|
||||||
print(f'Standard Error: {result.stderr}')
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# only continue, if we have a process object initialized
|
# only continue, if we have a process object initialized
|
||||||
if hasattr(Daemon.rigctldprocess, "returncode"):
|
if hasattr(Daemon.rigctldprocess, "returncode"):
|
||||||
|
|
||||||
if Daemon.rigctldprocess.returncode in [None, "None"] or not Daemon.rigctldstarted:
|
if Daemon.rigctldprocess.returncode in [None, "None"] or not Daemon.rigctldstarted:
|
||||||
Daemon.rigctldstarted = True
|
Daemon.rigctldstarted = True
|
||||||
#outs, errs = Daemon.rigctldprocess.communicate(timeout=10)
|
outs, errs = Daemon.rigctldprocess.communicate(timeout=10)
|
||||||
#print(f"outs: {outs}")
|
print(f"outs: {outs}")
|
||||||
#print(f"errs: {errs}")
|
print(f"errs: {errs}")
|
||||||
print(Daemon.rigctldprocess)
|
|
||||||
result = Daemon.rigctldprocess
|
|
||||||
print(f'Standard Output: {result.stdout}')
|
|
||||||
print(f'Standard Error: {result.stderr}')
|
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.log.warning("[DMN] [RIGCTLD] [Watchdog] returncode detected",process=Daemon.rigctldprocess)
|
self.log.warning("[DMN] [RIGCTLD] [Watchdog] returncode detected",process=Daemon.rigctldprocess)
|
||||||
|
@ -119,8 +106,8 @@ class DAEMON:
|
||||||
# erase process object
|
# erase process object
|
||||||
Daemon.rigctldprocess = None
|
Daemon.rigctldprocess = None
|
||||||
else:
|
else:
|
||||||
#Daemon.rigctldstarted = False
|
Daemon.rigctldstarted = False
|
||||||
pass
|
|
||||||
#try:
|
#try:
|
||||||
# outs, errs = proc.communicate(timeout=15)
|
# outs, errs = proc.communicate(timeout=15)
|
||||||
#except TimeoutExpired:
|
#except TimeoutExpired:
|
||||||
|
@ -428,18 +415,14 @@ class DAEMON:
|
||||||
#proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
#proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
||||||
#proc = subprocess.Popen(command)
|
#proc = subprocess.Popen(command)
|
||||||
proc = subprocess.run(command, shell=False, check=True, text=True, capture_output=True)
|
proc = subprocess.run(command, shell=False, check=True, text=True, capture_output=True)
|
||||||
print(f'Standard Output: {proc.stdout}')
|
|
||||||
print(f'Standard Error: {proc.stderr}')
|
|
||||||
else:
|
else:
|
||||||
#On windows, open rigctld in new window for easier troubleshooting
|
#On windows, open rigctld in new window for easier troubleshooting
|
||||||
proc = subprocess.Popen(command, creationflags=subprocess.CREATE_NEW_CONSOLE,close_fds=True)
|
proc = subprocess.Popen(command, creationflags=subprocess.CREATE_NEW_CONSOLE,close_fds=True)
|
||||||
|
|
||||||
atexit.register(proc.kill)
|
|
||||||
|
|
||||||
Daemon.rigctldstarted = True
|
Daemon.rigctldstarted = True
|
||||||
Daemon.rigctldprocess = proc
|
Daemon.rigctldprocess = proc
|
||||||
|
|
||||||
|
atexit.register(proc.kill)
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
self.log.warning("[DMN] err starting rigctld: ", e=err)
|
self.log.warning("[DMN] err starting rigctld: ", e=err)
|
||||||
|
|
Loading…
Reference in a new issue