mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-12-02 07:33:45 +08:00
fix manager on mac
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import datetime
|
||||
import os
|
||||
import platform
|
||||
import signal
|
||||
import sys
|
||||
import time
|
||||
@@ -221,7 +222,8 @@ def main() -> None:
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unblock_stdout()
|
||||
if platform.system() != "Darwin":
|
||||
unblock_stdout()
|
||||
|
||||
try:
|
||||
main()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import importlib
|
||||
import os
|
||||
import platform
|
||||
import signal
|
||||
import time
|
||||
import subprocess
|
||||
@@ -193,10 +194,13 @@ class DaemonProcess(ManagerProcess):
|
||||
if pid is not None:
|
||||
try:
|
||||
os.kill(int(pid), 0)
|
||||
with open(f'/proc/{pid}/cmdline') as f:
|
||||
if self.module in f.read():
|
||||
# daemon is running
|
||||
return
|
||||
if platform.system() == 'Darwin':
|
||||
return
|
||||
else:
|
||||
with open(f'/proc/{pid}/cmdline') as f:
|
||||
if self.module in f.read():
|
||||
# daemon is running
|
||||
return
|
||||
except (OSError, FileNotFoundError):
|
||||
# process is dead
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user