mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Attempt to fix dispatcher crash on restart (#12257)
This commit is contained in:
@ -225,7 +225,7 @@ class ServiceConfig:
|
||||
def _get_config_data(self):
|
||||
try:
|
||||
import dotenv
|
||||
env_path = "{}/.env".format(self.BASE_DIR)
|
||||
env_path = "{}/.env".format(self.BASE_DIR)
|
||||
info("Attempting to load .env from '%s'", env_path)
|
||||
dotenv.load_dotenv(dotenv_path=env_path, verbose=True)
|
||||
|
||||
@ -314,7 +314,7 @@ class Service:
|
||||
# Speed things up by only looking at direct zombie children
|
||||
for p in psutil.Process().children(recursive=False):
|
||||
try:
|
||||
cmd = p.cmdline() # cmdline is uncached, so needs to go here to avoid NoSuchProcess
|
||||
cmd = p.cmdline() # cmdline is uncached, so needs to go here to avoid NoSuchProcess
|
||||
status = p.status()
|
||||
|
||||
if status == psutil.STATUS_ZOMBIE:
|
||||
@ -529,7 +529,7 @@ class Service:
|
||||
return
|
||||
|
||||
info('Restarting service... ')
|
||||
|
||||
|
||||
if 'psutil' not in sys.modules:
|
||||
warning("psutil is not available, polling gap possible")
|
||||
self._stop_managers_and_wait()
|
||||
@ -547,7 +547,8 @@ class Service:
|
||||
:param signalnum: UNIX signal number
|
||||
:param flag: Flags accompanying signal
|
||||
"""
|
||||
if (signal(SIGCHLD, SIG_DFL) == SIG_DFL):
|
||||
handler = signal(SIGCHLD, SIG_DFL)
|
||||
if handler == SIG_DFL:
|
||||
# signal is already being handled, bail out as this handler is not reentrant - the kernel will re-raise the signal later
|
||||
return
|
||||
|
||||
|
Reference in New Issue
Block a user