Skip to content

Commit

Permalink
Merge pull request #2399 from kamil-certat/fix-stoping
Browse files Browse the repository at this point in the history
FIX: Keep standalone flag after reloading
  • Loading branch information
sebix authored Aug 28, 2023
2 parents 8bb7035 + e1490a9 commit 5b94c9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CHANGELOG
### Configuration

### Core
- Fixed issue preventing bots from stopping after reloading (PR by Kamil Mankowski).

### Development

Expand Down
4 changes: 2 additions & 2 deletions intelmq/lib/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def __init__(self, bot_id: str, start: bool = False, sighup_event=None,
version_info = sys.version.splitlines()[0].strip()
self.__log('info',
f'{self.__class__.__name__} initialized with id {bot_id} and intelmq {__version__}'
f' and python {version_info} as process {os.getpid()}.')
f' and python {version_info} as process {os.getpid()}. Standalone mode: {self._standalone}.')
self.__log('debug', f'Library path: {__file__!r}.')

# in standalone mode, drop privileges
Expand Down Expand Up @@ -310,7 +310,7 @@ def __handle_sighup(self):
self.logger.exception('Error during shutdown of bot.')
self.logger.handlers = [] # remove all existing handlers
self.__sighup.clear()
self.__init__(self.__bot_id_full, sighup_event=self.__sighup)
self.__init__(self.__bot_id_full, sighup_event=self.__sighup, standalone=self._standalone)

def init(self):
pass
Expand Down

0 comments on commit 5b94c9e

Please sign in to comment.