[IntelMQ-dev] Intercepting a bot restart and shutdown

Sebastian Wagner wagner at cert.at
Fri Mar 12 10:42:33 CET 2021


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 at cert.at>
> To: "Mika Silander" <mika.silander at csc.fi>, "intelmq-dev" <intelmq-dev at 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
>
-- 
// Sebastian Wagner <wagner at cert.at> - T: +43 1 5056416 7201
// CERT Austria - https://www.cert.at/
// Eine Initiative der nic.at GmbH - https://www.nic.at/
// Firmenbuchnummer 172568b, LG Salzburg


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.cert.at/pipermail/intelmq-dev/attachments/20210312/e64e3368/attachment.sig>


More information about the IntelMQ-dev mailing list