Hi,
Yes, the shutdown method can be used to perform some actions before the bots actually stops. It can be defined by any bot and is often used to gracefully close connections, file descriptors etc.
Sebastian
On 3/12/21 10:33 AM, Mika Silander wrote:
Hi,
Only in select bots, not all. And I also noticed there's a shutdown method in class Bot which leads one to assume both stop and shutdown should be overridden, right?
Best regards, Mika
----- Original Message ----- From: "Sebastian Wagner" wagner@cert.at To: "Mika Silander" mika.silander@csc.fi, "intelmq-dev" intelmq-dev@lists.cert.at Sent: Friday, 12 March, 2021 11:30:08 Subject: Re: [IntelMQ-dev] Intercepting a bot restart and shutdown
Dear Mika,
On 3/12/21 10:28 AM, Mika Silander wrote:
A technicality: what is the best way to intercept a bot restart or shutdown (stopping the bot)? I see the Bot class has a stop method, so I assume overriding this method in our own bots would do the trick, correct? In practise, we'd have the usual init and process methods of the bots extended with a stop method that performs its operations and finally calls the super classes' stop(?)
I'm looking for ways to write a bot's state information to disk before a restart/stopping.
Only in one particular bot or for all bots?
kind regards