mirror of
https://github.com/chatmail/core.git
synced 2026-04-26 18:06:35 +03:00
fix: run deltachat-rpc-server in its own process group
This ensures the server does not get SIGINT when the bot is running in a terminal and user presses ^C We want to send SIGTERM ourselves after clean shutdown, e.g. stopping I/O for all accounts.
This commit is contained in:
@@ -39,6 +39,10 @@ class Rpc:
|
||||
"deltachat-rpc-server",
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
# Prevent subprocess from capturing SIGINT.
|
||||
# We are not using `process_group`
|
||||
# because it is not supported before Python 3.11.
|
||||
preexec_fn=os.setpgrp,
|
||||
**self._kwargs,
|
||||
)
|
||||
self.id = 0
|
||||
|
||||
Reference in New Issue
Block a user