Compare commits

...

5 Commits

Author SHA1 Message Date
Pavel Loginov 35bd366f55
Merge pull request #425 from e345/patch-1
Update action.py : Redirect Docker command output to prevent Python hang
2025-09-23 09:44:28 +03:00
e345 d7c07b75b1
Merge pull request #1 from e345/e345-patch-1
Update action.py : Redirect Docker command output to prevent Python hang
2025-09-22 15:42:31 +08:00
e345 b25ce00e12
Update action.py : Redirect Docker command output to prevent Python hang
When executing Docker commands via Python, such as `docker kill -s HUP <container>`, the process may hang because the command produces output that blocks the Python subprocess.  

This change appends `> /dev/null` to Docker commands to discard any standard output, ensuring that Python can execute the command without waiting indefinitely.  

Systemd commands remain unchanged, as they do not exhibit the same blocking behavior.
2025-09-22 15:41:50 +08:00
Pavel Loginov 90050a9bd0
Merge pull request #424 from e345/patch-1
Update action.py: correct docker kill signal option case
2025-09-22 09:07:08 +03:00
e345 6b7cfd1e86
Update action.py: correct docker kill signal option case
Previously, when handling the reload action, the code used `docker kill -S HUP`.
However, the Docker CLI only supports the lowercase `-s` option.
Using `-S` results in an error and prevents the signal from being sent to the container process.

This change:
- Corrects `kill -S HUP` to `kill -s HUP`
- Ensures that in Docker mode, the reload action can properly send the SIGHUP signal
- Keeps the systemd branch logic unchanged
2025-09-22 13:53:50 +08:00
1 changed files with 2 additions and 2 deletions

View File

@ -56,8 +56,8 @@ def get_action_command(service: str, action: str, server_id: int) -> str:
if is_docker == '1':
container_name = sql.get_setting(f'{service}_container_name')
if action == 'reload':
action = 'kill -S HUP'
commands = f"sudo docker {action} {container_name}"
action = 'kill -s HUP'
commands = f"sudo docker {action} {container_name} > /dev/null"
else:
service_name = service_common.get_correct_service_name(service, server_id)
commands = f"sudo systemctl {action} {service_name}"