From 432a8b20598b9d76aaa0b662132ebeb2425a8a59 Mon Sep 17 00:00:00 2001 From: Dita Aji Pratama Date: Wed, 10 Jun 2026 21:13:15 +0700 Subject: [PATCH] Fixing nohup issue --- services/xmpp_client.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/services/xmpp_client.py b/services/xmpp_client.py index dd7158e..65a5555 100644 --- a/services/xmpp_client.py +++ b/services/xmpp_client.py @@ -465,11 +465,15 @@ class XMPPClient(ClientXMPP): async def _run(self): self._stopped = asyncio.Event() self._loop = asyncio.get_running_loop() - for sig in (signal.SIGTERM, signal.SIGHUP): - try: - self._loop.add_signal_handler(sig, self._stopped.set) - except NotImplementedError: - pass + + # Hanya tangani SIGTERM untuk shutdown. + # SENGATKAN SIGHUP: nohup kirim SIGHUP saat terminal close, + # dan kita tidak mau proses mati karena itu. + try: + self._loop.add_signal_handler(signal.SIGTERM, self._stopped.set) + except NotImplementedError: + pass + await self.connect() try: await self._stopped.wait()