From 205fdbc05a8f35a2f2a073985e4714bf10f7feb5 Mon Sep 17 00:00:00 2001 From: Chris Josten Date: Mon, 2 Feb 2026 12:43:15 +0100 Subject: [PATCH] System{Info,Logs}: use sh instead of bash Bash is not available in Alpine images. In bb1ce0a0388a5b0ee90b4ceb669ec39dc567f395, the Docker image was changed to Alpine from Debian, which caused 500 errors in the SystemInfoViewSet and SystemLogsViewSet. Now it calls "sh" instead of "/bin/bash", which should be more portable across different distributions. Since no bash-exclusive features were used, this was trivial. Fixes finmars-platform/finmars-core#62 --- poms/api/views.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/poms/api/views.py b/poms/api/views.py index 6277334d8..f16add79e 100644 --- a/poms/api/views.py +++ b/poms/api/views.py @@ -628,7 +628,7 @@ def __vm_info( ) shell_cmd = "ps aux | grep [b]ackend" - c = pexpect.spawn("/bin/bash", ["-c", shell_cmd]) + c = pexpect.spawn("sh", ["-c", shell_cmd]) pexpect_result = c.read() celery_worker_state = True @@ -647,7 +647,7 @@ def __vm_info( ) shell_cmd = "ps aux | grep [d]jango_celery_beat" - c = pexpect.spawn("/bin/bash", ["-c", shell_cmd]) + c = pexpect.spawn("sh", ["-c", shell_cmd]) pexpect_result = c.read() celery_beat_state = True @@ -678,7 +678,7 @@ def __pip_freeze_info(self): if not getattr(self, "pip_freeze_data", None): self.pip_freeze_data = {"all": {}, "django": "-"} - c = pexpect.spawn("/bin/bash", ["-c", "pip3 freeze"]) + c = pexpect.spawn("sh", ["-c", "pip3 freeze"]) for freeze_item in c.readlines(): if freeze_item: @@ -871,7 +871,7 @@ def list(self, request, *args, **kwargs): result = {} shell_cmd = "ls -la /var/log/finmars/backend/ | awk '{print $9}'" - c = pexpect.spawn("/bin/bash", ["-c", shell_cmd]) + c = pexpect.spawn("sh", ["-c", shell_cmd]) pexpect_result = c.read().decode("utf-8") # items = pexpect_result.split('\')